如何安装Windows 10 SDK以与Visual Studio 2017一起使用

如何安装Windows 10 SDK以与Visual Studio 2017一起使用

问题描述:

我不知道如何为Visual Studio 2017安装Windows 10 SDK.

I can't figure out how to install Windows 10 SDK for Visual Studio 2017.

我下载并运行Windows 10 SDK安装程序,它显示请在.... \ Windows kits \ 10 \ WindowsSDK中找到winsdksetup.exe,以安装Windows软件开发工具包-Windows 10.0.17134.12.

I downloaded and ran the Windows 10 SDK installer, and it displays Please find winsdksetup.exe in ....\Windows kits\10\WindowsSDK to install Windows Software Development Kit - Windows 10.0.17134.12.

当我运行 winsdksetup.exe 时,它会带我经历相同的循环,在该循环中,它将一堆可执行安装程序下载到该目录中并显示相同的消息.

When I run winsdksetup.exe, it takes me through the same loop, where it downloads a bunch of executable installers into this directory and show the same exact message.

当我尝试在VS2017中构建DirectX项目时,出现错误:

When I try to build a DirectX project in VS2017, I get the error:

MSB8036 The Windows SDK version 10.0.16299.0 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".    

我需要安装其中一个安装程序吗?我需要运行哪一个来构建和调试Visual Studio的DirectX项目?专门用于使用VS2017着色器调试功能.

Do I need to install one of those installers? Which one do I need to run to build and debug DirectX projects for Visual Studio? Specifically to use VS2017 shader debugging functionality.

谢谢

在VS2017下-工具->获取工具和功能我已经检查了

Under VS2017 - Tools -> Get Tools and Features I have checked

使用C ++开发游戏

,在可选"下,我有

C ++分析工具Windows 10 SDK(10.0.17134.0)

C++ Profiling tools Windows 10 SDK (10.0.17134.0)

我正在下载16299.0,这解决了第一个错误,即没有正确的SDK.

I'm downloading 16299.0, this fixed the first error of not having the right SDK.

但是现在我在调试中运行时收到运行时错误无法创建Direct3D设备.我仍然可以在Release中运行示例

But now I get the runtime error Failed Creating the Direct3D device when running in Debug. I can still run samples in Release

错误消息显示所需的SDK:

The error message shows which SDK you need:

找不到Windows SDK版本10.0.16299.0

The Windows SDK version 10.0.16299.0 was not found

因此Windows 10 Fall Creators Update 1709的SDK丢失了,您下载了2018年4月更新的SDK(1803 Build 17134).

So the SDK for Windows 10 Fall Creators Update 1709 is missing and you downloaded the SDK for April 2018 Update (1803 Build 17134).

运行Visual Studio 2017安装程序( C:\ Program Files(x86)\ Microsoft Visual Studio \ Installer \ vs_installer.exe ),单击 modify 并选择16299安装程序的单个组件"选项卡中"SDK/框架"下的SDK:

Run Visual Studio 2017 installer (C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe), click on modify, and select 16299 SDK under SDK/framework in individual components tab of the installer: