Share via

UWP App will not build using windows-latest (windows 2022) on Azure Pipeline

Stefan Buys 6 Reputation points
May 25, 2022, 7:09 AM

I am trying to build a UWP app using the latest version of windows for my vmImage, currently the build script looks like this:

# Universal Windows Platform
# Build a Universal Windows Platform project using Visual Studio.
# Add steps that test and distribute an app, save build artifacts, and more:
# https://aka.ms/yaml

trigger:
- none

pool:
  vmImage: 'windows-2019'

variables:
  solution: '**/*.sln'
  buildPlatform: 'ARM'
  buildConfiguration: 'Release'
  appxPackageDir: '$(build.artifactStagingDirectory)\AppxPackages\\'

Whenever I try to use windows-latest or windows-2022 it gives me multiple Error CS0234 for namespace Windows, System and a bunch of other things, is it possible to build UWP apps using windows-2022? Or am I missing something.

Other people have mentioned they solved their problem but their platform was ARMx64 and the solution did not apply to my problem.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
43,128 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Stefan Buys 6 Reputation points
    May 25, 2022, 12:31 PM

    I sorted this out, so I thought I would just leave my solution here if anyone has the same problem in the future.

    In the windows-latest to windows-2022 upgrade thread, someone posted a link to the Windows 10 SDK versions supported by windows-2022. I was targeting Windows 10, version 1903 which requires Windows 10 SDK 10.0.18362.0, this version of the SDK does not ship with the windows-2022 image. The SDKs that ships with windows-2022 are:

    10.0.17763.0
    10.0.19041.0
    10.0.20348.0
    10.0.22000.0
    

    I changed the target Windows version of my app to Windows 10, version 2004 (the SDK is in windows-2022) and it built fine. My min version is Windows 10, version 1809 (the SDK is also in windows-2022) as this is the latest version of Windows 10, Windows 10 IoT Core ships with.

    Alexander Schmidt has a nice (but little outdated) article explaining the windows SDKs the different Azure DevOps agents ship with.

    1 person found this answer helpful.
    0 comments No comments

  2. vipullag-MSFT 26,476 Reputation points
    May 25, 2022, 11:59 AM

    @Stefan Buys

    Welcome to Microsoft Q&A Platform, thanks for posting your query here.

    Azure DevOps related queries/issues are currently not supported on this Microsoft Q&A platform. Please check this supported products list here (more to be added later on).

    I would request you to please post your queries in dedicated forums as in below links:
    https://developercommunity.visualstudio.com/spaces/21/index.html
    https://developercommunity.visualstudio.com/t/get-unique-id-from-devops-organization/756710
    https://stackoverflow.com/questions/tagged/azure-devops

    Hope that helps.
    Please 'Accept as answer' if it helped, so that it can help others in the community looking for help on similar topics.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.