I am trying to set up a build pipeline for the Windows Universal Sample Application File Access Project.
The pipeline is using the Azure Pipelines Hosted VS2017 Image
The solution builds when I run it in VS locally.
Package.appxmanifest contains
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.10586.0" MaxVersionTested="10.0.17763.0" />
When the pipeline tries to build the following error appears in the build task log.
Error CS0234: The type or namespace name 'ApplicationModel'
does not exist in the namespace 'Windows'
(are you missing an assembly reference?)
The YAML is
resources:
- repo: self
queue:
name: Hosted VS2017
demands:
- msbuild
- visualstudio
steps:
- task: NuGetCommand@2
displayName: 'NuGet restore'
- task: VSBuild@1
displayName: 'Build solution ***.sln'
The project looks like this on my machine
Where
And it runs correctly.
I notice the log for the Nuget Restore task has no errors and does report
2018-12-16T01:27:31.8700773Z Checking compatibility for Microsoft.NETCore.Targets.UniversalWindowsPlatform 5.0.0 with UAP,Version=v10.0 (win10-x86-aot).
2018-12-16T01:27:31.8700831Z Checking compatibility for Microsoft.NETCore.Platforms 1.0.0 with UAP,Version=v10.0 (win10-x86-aot).
2018-12-16T01:27:31.8700878Z All packages and projects are compatible with UAP,Version=v10.0 (win10-x86-aot).
[Update]
Looking at the location on my machine of the SDK
C:Program Files (x86)Windows Kits10References10.0.17763.0Windows.AI.MachineLearning.MachineLearningContract1.0.0.0
I wonder how Nuget is meant to know about that.
Indeed I wonder why it has something about MachineLearning in the path.
[Update]
I changed versions to 17134 (RS4/1803) instead of 17763 (RS5/1809) as suggested by Stefan Wick MSFT
The errors changed to
C:Program Files (x86)Microsoft Visual Studio2017EnterpriseMSBuildMicrosoftVisualStudiov15.0AppxPackageMicrosoft
.AppXPackage.Targets(3218,5): Error APPX0101: A signing key is required in
order to package this project. Please specify a PackageCertificateKeyFile or
PackageCertificateThumbprint value in the project file.
Process 'msbuild.exe' exited with code '1'.
SharedContentTemplatesUWPSDKSampleCPPARMDebugUWPSDKSampleCPPAppxManifest.xml(0,0):
Error APPX0501: Validation error. error C00CE169: App manifest validation
error: The app manifest must be valid as per schema: Line 10, Column 13,
Reason: 'Microsoft.SDKSamples.$safeprojectname$.CPP' violates pattern
constraint of '[-.A-Za-z0-9]+'. The attribute 'Name' with value
'Microsoft.SDKSamples.$safeprojectname$.CPP' failed to parse.
Process 'msbuild.exe' exited with code '1'.
SharedContentTemplatesUWPSDKSampleCSinARMDebugAppxManifest.xml(0,0):
Error APPX0501: Validation error. error C00CE169: App manifest validation error:
The app manifest must be valid as per schema: Line 10, Column 13, Reason: 'Microsoft.SDKSamples.$safeprojectname$.CS' violates pattern constraint of '[-.A-Za-z0-9]+'.
The attribute 'Name' with value 'Microsoft.SDKSamples.$safeprojectname$.CS' failed to parse.
Process 'msbuild.exe' exited with code '1'
See Question&Answers more detail:
os