简体   繁体   中英

Installing the Windows SDK 8.1 version in Azure Pipelines

I want to upgrade my Azure Pipeline vmImage to 'windows-2019' in order to compile my project with Visual Studio 2019.

pool:
  vmImage: 'windows-2019'

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

steps:
- task: VSBuild@1
  displayName: 'Build the project'
  inputs:
    solution: '$(solution)'
    configuration: '$(buildConfiguration)'
    msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload'
- task: VSTest@2

However, the Windows SDK 8.1 seems not to be included in this image. When I try to compile my C++ project:

##[error]C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v150\Microsoft.Cpp.WindowsSDK.targets(46,5): Error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution".

How to install it in this image?

Related:

How to fix the error "Windows SDK version 8.1" was not found?

I used choco in order to get the Windows 8.1 SDK:

- task: PowerShell@2
  displayName: 'Install the win 8.1 SDK'
  inputs:
    targetType: 'inline'
    script: |
      choco install windows-sdk-8.1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM