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

I recently updated visual studio 2015 and now, when i try to build any project it always fails and i get the error

Severity Code Description Project File Line Suppression State 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". Proj D:\Program Files (x86)\visual studio 2017\Common7\IDE\VC\VCTargets\Platforms\Win32\PlatformToolsets\v141\Toolset.targets 34

I retargeted the solution as it said, and the problem persisted, even though the retargetting was completed.I decided to install visual studio 2017 because of this, and, lo and behold, it did the exact same thing.I'm also using windows 7.

What is the problem and how can i fix it?

193551 次浏览

我也遇到过这个问题。重新运行 VisualStudio2017安装程序,转到 'Individual Components'并选择 Windows 8.1 SDK。返回到项目 > 右键单击并重定向以匹配所需的 SDK,如下所示:enter image description here

我有 win10 SDK,我只需要做重定向,然后我停止得到这个错误。其想法是,该项目需要升级其目标 WindowsSDK。

另一种方式(2015年工作)是打开“安装/删除程序”(应用程序和功能) ,找到 Visual Studio,选择修改。在打开的窗口中,按“修改”,选中

  • Languages -> Visual C++ -> Common tools for Visual C++
  • Windows 和 web 开发-> 通用 Windows 应用程序工具-> 工具(1.4.1) and Windows 10 SDK ([version])
  • Windows and web development -> Tools for universal windows apps -> Windows 10 SDK ([version])

然后右键单击 Solution-> Re-target,就可以编译了

我安装了8.1 SDK 的版本:

Https://developer.microsoft.com/en-us/windows/downloads/sdk-archive

它在安装中使用了1GB (稍微多一点)。


更新日期: 2020年10月9日。有一个 https 错误: sdksetup 链接是“一个 href = “ https://go.microsoft.com/fwlink/p/? LinkId = 323507”rel = “ noReferrer”> https://go.microsoft.com/fwlink/p/?linkid=323507

“保存链接”应该会有帮助。

  • 安装所需版本的 WindowsSDK 或更改 SDK 版本 在项目属性页中

    或者

  • 通过右键单击解决方案并选择“重定目标解决方案”

如果你做视觉工作室指南,你会解决这个问题。

I realize this post is a few years old, but I just wanted to extend this to anyone still struggling through this issue.

The company I work for still uses VS2015 so in turn I still use VS2015. I recently started working on a RPC application using C++ and found the need to download the Win32 Templates. Like many others I was having this "SDK 8.1 was not found" issue. i took the following corrective actions with no luck.

以上的尝试都没有为我纠正这个问题..。

然后我在社交 MSDN https://social.msdn.microsoft.com/Forums/office/en-US/5287c51b-46d0-4a79-baad-ddde36af4885/visual-studio-cant-find-windows-81-sdk-when-trying-to-build-vs2015?forum=visualstudiogeneral上找到了这篇文章

最终,我解决了这个问题:

  • 卸载和重新安装 VS2015。
  • Locating my installed "Windows Software Development Kit for Windows 8.1" and running the repair.
  • 检查我的“ C: Program Files (x86) Microsoft SDKs Windows Kit 8.1”来验证“ DesignTime”文件夹实际上是否存在。
  • Opened VS created a Win32 Console application and comiled with no errors or issues

我希望这可以帮助其他人避免整整3天的沮丧和工作效率的下降。

准备文件夹树的 *.vcxproj文件。当你更新一个项目时,用 <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>或任何 SDK 版本来替换 <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>

我在尝试构建 npm 项目时遇到了这个问题。它未能安装一个 node-sass 包,这就是它打印的错误。我通过正确设置 npm 代理来解决这个问题,这样它就可以到达 npm 回购

对于我来说,在项目属性设置一般-> 目标平台-> 更改 Windows 8.1到 Windows 10解决了这个问题