Azure DevOps 2019服务器上的UWP CI生成失败

Azure DevOps 2019服务器上的UWP CI生成失败,uwp,azure-devops,continuous-integration,windows-10-universal,azure-devops-self-hosted-agent,Uwp,Azure Devops,Continuous Integration,Windows 10 Universal,Azure Devops Self Hosted Agent,我已经在内部托管的AzureDevOps 2019服务器上配置了一个UWP CI,但由于以下错误而失败。我跟着。有人能指导我走向成功吗 配置后YAML如下所示: 资源: -回购:自我 队列: 名称:默认值 要求: -msbuild -visualstudio 生成管道引用名为“Parameters.solution”的未定义变量。创建或编辑此YAML文件的生成管道,在“变量”选项卡上定义变量。看见 生成管道引用名为“Parameters.secureFile”的未定义变量。创建或编辑此YAML文

我已经在内部托管的AzureDevOps 2019服务器上配置了一个UWP CI,但由于以下错误而失败。我跟着。有人能指导我走向成功吗

配置后YAML如下所示:

资源: -回购:自我 队列: 名称:默认值 要求: -msbuild -visualstudio

生成管道引用名为“Parameters.solution”的未定义变量。创建或编辑此YAML文件的生成管道,在“变量”选项卡上定义变量。看见 生成管道引用名为“Parameters.secureFile”的未定义变量。创建或编辑此YAML文件的生成管道,在“变量”选项卡上定义变量。看见 生成管道引用了名为“buildPlatform”的未定义变量。创建或编辑此YAML文件的生成管道,在“变量”选项卡上定义变量。看见 生成管道引用名为“cert.secureFilePath”的未定义变量。创建或编辑此YAML文件的生成管道,在“变量”选项卡上定义变量。看见 构建管道引用“BuildConfiguration”变量,您已选择该变量在队列时可设置。创建或编辑此YAML文件的生成管道,在“变量”选项卡上定义变量,然后选择该选项以使其在队列时可设置。看见 变量: appxPackageDir:“$(build.artifactStagingDirectory)\AppxPackages\” 步骤: -任务:NuGetToolInstaller@0 displayName:“使用NuGet 4.4.1” 投入: 版本规范:4.4.1

  • 任务:NuGetCommand@2 displayName:'NuGet restore***.sln' 投入: restoreSolution:“$(Parameters.solution)”

  • 任务:DownloadSecureFile@1 displayName:“下载安全文件” 投入: secureFile:“$(Parameters.secureFile)”

  • 任务:VSBuild@1 displayName:“生成解决方案主/BoardPACWinApp.sln” 投入: 解决方案:Main/BoardPACWinApp.sln VSV版本:16.0

msbuildArgs:“/p:AppxBundlePlatforms=“$(构建平台)”/p:AppxPackageDir=“$(AppxPackageDir)”/p:AppxBundle=Always/p:UAPAPPPXPackageBuilderMode=StoreUpload/p:AppxPackageSigningEnabled=true/p:PackageCertificateThumbprint=“/p:PackageCertificateKeyFile=“$(cert.secureFilePath)”” 站台:x64 配置:“$(构建配置)” 干净:是的 msbuildArchitecture:x64

  • 任务:PublishBuildArtifacts@1 displayName:“发布工件:删除” 投入: PathTopPublish:“$(Build.ArtifactStagingDirectory)\AppxPackages” 已启用:false

  • 任务:AppCenterDistribute@0 displayName:“部署到Visual Studio应用程序中心” 投入: 符号IncludeParentDirectory:false 已启用:false


对于这个设置,我使用了VS 2019 16.3构建工具,它有一个没有密码的测试证书(BoardPACWinApp_TemporaryKey.pfx)。请注意,我在构建服务器(Windows server 2019(OS build 17763.437))上安装了VS 2019,只是为了确保构建成功。但当我在DevOps构建代理上尝试同样的方法时,它会抛出错误

MSBuild参数:

[命令]“C:\ProgramFiles(x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\amd64\MSBuild.exe”“C:\agent\u work\4\s\Main\BoardPACWinApp.sln”/nologo/nr:false/dl:CentralLogger,“C:\agent\u work\u tasks\VSBuild\u 71a9a2d3-a98a-4caa-96ab-affca411ecda\1.146.0\ps\u modules\MSBuilders\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll”;“RootDetailId=1f510b32-fa94-449c-ba47-94B46A58669D0 | SolutionDir=C:\agent\u work\4\s\Main”*ForwardingLogger”C:\agent\u work\u tasks\VSBuild\u 71a9a2d3-a98a-4caa-96ab-affca411ecda\1.146.0\ps\u modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll”/p:AppxBundlePlatforms=“x64”/p:AppxPackageDir=“C:\agent\u work\4\a\AppxPackages\“/p:AppxBundle=Always/p:UAPAPPX PackageBuildMode=StoreUpload/p:AppxPackageSigningEnabled=true/p:PackageCertificateThumbprint=”“/p:PackageCertificateKeyFile=“C:\agent\u work\u temp\BoardPACWinApp\u TemporaryKey.pfx”/p:platform=“x64”/p:configuration=“release”/p:VisualStudioVersion=“16.0”/p:”MSDeploySerAgent=“TFS_22ec7900-72ed-4ebd-b5a6-D4BA51A10DD_构建_16_0”

错误:

[错误]C:\Program Files(x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppxPackage.Targets(1300,5):错误MSB3816:加载程序集“C:\Windows\ServiceProfiles\NetworkService.nuget\packages\runtime.win7.system.private.uri\4.3.0\runtimes\aot\lib\netcore50\system.private.uri.dll“失败了。System.IO.FileNotFoundException:无法加载文件或程序集'System.Private.CoreLib,版本=4.0.0.0,区域性=中性,PublicKeyToken=b03f5f7f11d50a3a'或其依赖项之一。系统找不到指定的文件

[错误]C:\Windows\ServiceProfiles\NetworkService.nuget\packages\runtime.win7.system.private.uri\4.3.0\runtimes\aot\lib\netcore50\system.private.uri.dll(0,0):错误MSB3103:无效的Resx文件。字符串引用未设置为字符串的实例。 参数名称:后缀

我的应用程序的csproj:

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{F48A0CA8-2DA5-472A-B973-602F1645B32C}</ProjectGuid>
<OutputType>AppContainerExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>com.IronOne.BoardPACWinApp</RootNamespace>
<AssemblyName>BoardPACWinApp</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.10240.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<PackageCertificateKeyFile>BoardPACWinApp_TemporaryKey.pfx</PackageCertificateKeyFile>
<PackageCertificateThumbprint>9B26FCF3AA71B71D3A1FE446F7002DB921BA5B68</PackageCertificateThumbprint>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
<AppxPackageDir>C:\temp\</AppxPackageDir>
<AppxBundlePlatforms>x86|x64|arm</AppxBundlePlatforms>
<AppxBundle>Always</AppxBundle>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<AppxSymbolPackageEnabled>True</AppxSymbolPackageEnabled>
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppInstallerUpdateFrequency>0</AppInstallerUpdateFrequency>
<AppInstallerCheckForUpdateFrequency>OnApplicationRun</AppInstallerCheckForUpdateFrequency>
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>

调试
x86
{F48A0CA8-2DA5-472A-B973-602F1645B32C}
AppContainerExe
性质
com.IronOne.BoardPACWinApp
BoardPACWinApp
恩美
UAP
10.0.10240.0
10.0.10240.0
14
512
{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
BoardPACWinApp_TemporaryKey.pfx
9B26FCF3AA71B71D3A1FE446F7002DB921BA5B68
假的
真的
C:\temp\
x86 | x64 |臂
总是
萨克
萨克
萨克
萨克
真的
假的
0
应用程序运行
真的
真的
0
SHA256


如果你想让我检查我的CI设置,让我知道我会这样做,并公布我收到的错误。谢谢。

我找到了解决办法。我把我原来的项目放在一边,在一个git回购示例中添加了一个新的UWP项目,并尝试构建解决方案,但出现了以下错误

2019-10-01T12:31:51.4254403Z ##[error]C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\1.7.6\tools\Microsoft.NetNative.targets(535,5): Error MSB4018: The "ComputeManagedBinaries" task failed unexpectedly. System.UnauthorizedAccessException: Access to the path 'C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Windows.winmd' is denied.
因此,我检查了“C:\ProgramFiles(x86)\Windows Kits\10”的访问权限