Default project created with WTS can't be build on Azure Devops.
To test it, create a new WTS project, add some pages or features and build it. For now, no problem.
Send your code to a git azure devops deposit.
Go to Build and Add Pipeline. Select your deposit, your project and use "Universal Windows Platform". A default YAML script is generated. Save and run it.
An error with dependancies versioning occurs :
The nuget command failed with exit code(1) and error(NU1201: Project App1.Core is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134). Project App1.Core supports: netstandard2.0 (.NETStandard,Version=v2.0)
NU1201: Project App1.Core is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-arm. Project App1.Core supports: netstandard2.0 (.NETStandard,Version=v2.0)
NU1201: Project App1.Core is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-arm-aot. Project App1.Core supports: netstandard2.0 (.NETStandard,Version=v2.0)
NU1201: Project App1.Core is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-arm64-aot. Project App1.Core supports: netstandard2.0 (.NETStandard,Version=v2.0)
NU1201: Project App1.Core is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-x64. Project App1.Core supports: netstandard2.0 (.NETStandard,Version=v2.0)
NU1201: Project App1.Core is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-x64-aot. Project App1.Core supports: netstandard2.0 (.NETStandard,Version=v2.0)
NU1201: Project App1.Core is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-x86. Project App1.Core supports: netstandard2.0 (.NETStandard,Version=v2.0)
NU1201: Project App1.Core is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-x86-aot. Project App1.Core supports: netstandard2.0 (.NETStandard,Version=v2.0)
Errors in d:\a\1\s\App1\App1.csproj
NU1201: Project App1.Core is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134). Project App1.Core supports: netstandard2.0 (.NETStandard,Version=v2.0)
NU1201: Project App1.Core is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-arm. Project App1.Core supports: netstandard2.0 (.NETStandard,Version=v2.0)
NU1201: Project App1.Core is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-arm-aot. Project App1.Core supports: netstandard2.0 (.NETStandard,Version=v2.0)
NU1201: Project App1.Core is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-arm64-aot. Project App1.Core supports: netstandard2.0 (.NETStandard,Version=v2.0)
NU1201: Project App1.Core is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-x64. Project App1.Core supports: netstandard2.0 (.NETStandard,Version=v2.0)
NU1201: Project App1.Core is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-x64-aot. Project App1.Core supports: netstandard2.0 (.NETStandard,Version=v2.0)
NU1201: Project App1.Core is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-x86. Project App1.Core supports: netstandard2.0 (.NETStandard,Version=v2.0)
NU1201: Project App1.Core is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-x86-aot. Project App1.Core supports: netstandard2.0 (.NETStandard,Version=v2.0))
Packages failed to restore
How to fix it?
The issue isn't directly related to WinTS but the good news is it is easy to solve.
The default YAML file provided by AzurePipelines doesn't specify which version of the NuGet install task to use and so it uses an older version that cannot support .NET Standard in UWP apps.
To address this, simply modify the YAML script to add the versionspec input to the NuGetToolInstaller task. Like this:
...
steps:
- task: NuGetToolInstaller@0
inputs:
versionSpec: '4.9.2'
...
Your WinTS generated app should now build in AzurePipelines without issue.
Most helpful comment
The issue isn't directly related to WinTS but the good news is it is easy to solve.
The default YAML file provided by AzurePipelines doesn't specify which version of the NuGet install task to use and so it uses an older version that cannot support .NET Standard in UWP apps.
To address this, simply modify the YAML script to add the versionspec input to the NuGetToolInstaller task. Like this:
Your WinTS generated app should now build in AzurePipelines without issue.