I have configured a UWP CI on inhouse hosted AzureDevOps 2019 server and it fails with following errors. I have followed this as a guide. Can someone guide me on this towards success?
YAML is as follows after the configuration:
resources: - repo: self queue: name: Default demands: - msbuild - visualstudio
Your build pipeline references an undefined variable named ‘Parameters.solution’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972 Your build pipeline references an undefined variable named ‘Parameters.secureFile’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972 Your build pipeline references an undefined variable named ‘buildPlatform’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972 Your build pipeline references an undefined variable named ‘cert.secureFilePath’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972 Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971 variables: appxPackageDir: '$(build.artifactStagingDirectory)\AppxPackages\' steps: - task: NuGetToolInstaller@0 displayName: 'Use NuGet 4.4.1' inputs: versionSpec: 4.4.1
task: NuGetCommand@2 displayName: 'NuGet restore ***.sln' inputs: restoreSolution: '$(Parameters.solution)'
task: DownloadSecureFile@1 displayName: 'Download secure file' inputs: secureFile: '$(Parameters.secureFile)'
task: VSBuild@1 displayName: 'Build solution Main/BoardPACWinApp.sln' inputs: solution: Main/BoardPACWinApp.sln vsVersion: 16.0
msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="" /p:PackageCertificateKeyFile="$(cert.secureFilePath)"' platform: x64 configuration: '$(BuildConfiguration)' clean: true msbuildArchitecture: x64
task: PublishBuildArtifacts@1 displayName: 'Publish artifact: drop' inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)\AppxPackages' enabled: false
task: AppCenterDistribute@0 displayName: 'Deploy to Visual Studio App Center' inputs: symbolsIncludeParentDirectory: false enabled: false
For this setup, I used VS 2019 16.3 build tools with a test certificate (BoardPACWinApp_TemporaryKey.pfx) with no password. Please note I have installed VS 2019 on the build server (Windows Server 2019 (OS Build 17763.437)) just to make sure the build is a success and it does. But when I try the same thing on DevOps build agent it throws errors.
MSBuild Args:
[command]"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\amd64\msbuild.exe" "C:\agent_work\4\s\Main\BoardPACWinApp.sln" /nologo /nr:false /dl:CentralLogger,"C:\agent_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.146.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=1f510b32-fa94-449c-ba47-94b46a5869d0|SolutionDir=C:\agent_work\4\s\Main"*ForwardingLogger,"C:\agent_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.146.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:AppxBundlePlatforms="x64" /p:AppxPackageDir="C:\agent_work\4\a\AppxPackages\" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="" /p:PackageCertificateKeyFile="C:\agent_work_temp\BoardPACWinApp_TemporaryKey.pfx" /p:platform="x64" /p:configuration="release" /p:VisualStudioVersion="16.0" /p:_MSDeployUserAgent="TFS_22ec7900-72ed-4ebd-b5a6-d4ba51a210dd_build_16_0"
Error:
[error]C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets(1300,5): Error MSB3816: Loading assembly "C:\Windows\ServiceProfiles\NetworkService.nuget\packages\runtime.win7.system.private.uri\4.3.0\runtimes\aot\lib\netcore50\System.Private.Uri.dll" failed. System.IO.FileNotFoundException: Could not load file or assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
[error]C:\Windows\ServiceProfiles\NetworkService.nuget\packages\runtime.win7.system.private.uri\4.3.0\runtimes\aot\lib\netcore50\System.Private.Uri.dll(0,0): Error MSB3103: Invalid Resx file. String reference not set to an instance of a String. Parameter name: suffix
csproj of my app:
<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>
If you want me to tweek my CI setup let me know I'll do and post the errors I'm getting. Thank you.
/p:VisualStudioVersion=16.0
to the MSBuild Args in the VS build task, then check the build result. – Leo Liu-MSFTNetworkService.nuget` paths instead of
NetworkService\.nuget`, did not make any progress, sorry. – Leo Liu-MSFT