如果自签名清单,C# 无法在 Azure 管道中传递构建
C# Unable pass build in Azure pipeline if self signed the manifest
我有一个使用 .NET 框架在 Visual Studio 中构建的 WPF 项目。该应用程序将部署在多个位置,以便不同网络上的用户能够 运行 它并获取更新(发布 -> 应用程序更新 -> 在应用程序启动之前)。
我正在尝试设置管道以最终测试应用程序并将其发布到多个位置。为了增加安全性,我决定使用(签名 -> 签署 ClickOnce 清单)自行签署清单。
根据我所读 (What is signing ClickOnce manifests for?) 的内容,您应该签署一份清单以向您的用户增加应用程序/更新来自您的安全性。
我的问题是,当 Azure 尝试在管道中构建应用程序时,它会生成以下错误。
短:
Error MSB3323: Unable to find manifest signing certificate in the certificate store
长:
##[error]C:\Program Files (x86)\Microsoft Visual Studio19\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3222,5): Error MSB3323: Unable to find manifest signing certificate in the certificate store.
Google 搜索的解决方案似乎要求我删除此安全功能。 (“Unable to find manifest signing certificate in the certificate store” - even when add new key)
我是否误解了解决方案、自签名的原因或者我应该寻找其他解决方案? (注意:我们不打算从第三方购买证书。)
有关应用程序的其他信息
安全 -> [选中:true] 启用 ClickOnce 安全设置
和
安全 -> 这是一个完全信任的应用程序
如果您需要有关 project/solution/build/Azure 设置/...的更多信息,请告诉我...不确定与问题相关的内容,我不想在这里转储整个项目。请询问,我会更新。
编辑:
YML 文档。
# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
如果您 运行 以与内部部署相同的方式进行签名,那么使用像内部部署一样的自托管代理是这里的解决方案。托管机器不会在证书存储中安装您的证书。
我有一个使用 .NET 框架在 Visual Studio 中构建的 WPF 项目。该应用程序将部署在多个位置,以便不同网络上的用户能够 运行 它并获取更新(发布 -> 应用程序更新 -> 在应用程序启动之前)。
我正在尝试设置管道以最终测试应用程序并将其发布到多个位置。为了增加安全性,我决定使用(签名 -> 签署 ClickOnce 清单)自行签署清单。
根据我所读 (What is signing ClickOnce manifests for?) 的内容,您应该签署一份清单以向您的用户增加应用程序/更新来自您的安全性。
我的问题是,当 Azure 尝试在管道中构建应用程序时,它会生成以下错误。
短:
Error MSB3323: Unable to find manifest signing certificate in the certificate store
长:
##[error]C:\Program Files (x86)\Microsoft Visual Studio19\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3222,5): Error MSB3323: Unable to find manifest signing certificate in the certificate store.
Google 搜索的解决方案似乎要求我删除此安全功能。 (“Unable to find manifest signing certificate in the certificate store” - even when add new key)
我是否误解了解决方案、自签名的原因或者我应该寻找其他解决方案? (注意:我们不打算从第三方购买证书。)
有关应用程序的其他信息
安全 -> [选中:true] 启用 ClickOnce 安全设置
和
安全 -> 这是一个完全信任的应用程序
如果您需要有关 project/solution/build/Azure 设置/...的更多信息,请告诉我...不确定与问题相关的内容,我不想在这里转储整个项目。请询问,我会更新。
编辑:
YML 文档。
# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
如果您 运行 以与内部部署相同的方式进行签名,那么使用像内部部署一样的自托管代理是这里的解决方案。托管机器不会在证书存储中安装您的证书。