【问题标题】:Installing the Windows SDK 8.1 version in Azure Pipelines在 Azure Pipelines 中安装 Windows SDK 8.1 版本
【发布时间】:2021-08-09 15:05:58
【问题描述】:

我想将我的 Azure Pipeline vmImage 升级到“windows-2019”,以便使用 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

但是,此图中的 Windows SDK 8.1 seems not to be included。当我尝试编译我的 C++ 项目时:

##[错误]C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v150\Microsoft.Cpp.WindowsSDK.targets(46,5): 错误 MSB8036:未找到 Windows SDK 版本 8.1。安装 所需的 Windows SDK 版本或更改 SDK 版本 项目属性页或通过右键单击解决方案并选择 “重定向解决方案”。

如何在这个镜像中安装它?

相关:

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

【问题讨论】:

  • 出于好奇,您为什么特别需要 8.1 SDK? Windows 8.1 SDK 中是否有任何内容未包含在 Windows 10 SDK 中?
  • @IInspectable 它是在工业环境中运行的遗留代码,运行它的一些计算机仍然是 WinXp。
  • 面向 Windows XP 并不要求您使用 Windows 8.1 SDK。除非有一些我不知道的更改,否则您可以使用 Windows 10 SDK 为 Windows XP 构建应用程序。
  • @IInspectable 可能是这样。前段时间我们在保持 WinXP 与此兼容时遇到了一些麻烦,所以我选择使用与以前相同的 SDK。不过值得一试,谢谢!
  • 据我所知,Windows API(及其 SDK)从一开始就完全兼容 ABI。改变的是平台工具集(即编译器及其支持库)。您必须使用与 Windows XP 兼容的平台工具集,但是(据我所知)SDK 没有这样的限制。

标签: c++ visual-studio winapi azure-pipelines visual-studio-2019


【解决方案1】:

我使用 choco 来获取 Windows 8.1 SDK:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-10
    • 2011-02-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多