简体   繁体   English

如何修复错误“Windows SDK version 8.1” not found?

[英]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我最近更新了 Visual Studio 2015,现在,当我尝试构建任何项目时,它总是失败并出现错误

Severity Code Description Project File Line Suppression State Error MSB8036 The Windows SDK version 8.1 was not found.严重性代码描述项目文件行抑制状态错误 MSB8036 未找到 Windows SDK 版本 8.1。 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".安装所需版本的 Windows SDK 或更改项目属性页中的 SDK 版本,或通过右键单击解决方案并选择“重定向解决方案”。 Proj D:\\Program Files (x86)\\visual studio 2017\\Common7\\IDE\\VC\\VCTargets\\Platforms\\Win32\\PlatformToolsets\\v141\\Toolset.targets 34 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.我按照它所说的重新定位了解决方案,即使重新定位已完成,问题仍然存在。因此,我决定安装 Visual Studio 2017,并且,瞧,它做了完全相同的事情。我也在使用 Windows 7.

What is the problem and how can i fix it?有什么问题,我该如何解决?

I faced this problem too.我也遇到了这个问题。 Re-ran the Visual Studio 2017 Installer , go to 'Individual Components' and select Windows 8.1 SDK .重新运行Visual Studio 2017 安装程序,转到“独立组件”并选择Windows 8.1 SDK Go back to to the project > Right click and Re-target to match the SDK required as shown below:返回到项目>右键单击并重新定位以匹配所需的SDK,如下所示: 在此处输入图片说明

I installed the 8.1 SDK's version:我安装了 8.1 SDK 的版本:

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

It used 1GB (a little more) in the installation.它在安装中使用了 1GB(多一点)。


Update October, 9. There's a https error: the sdksetup link is https://go.microsoft.com/fwlink/p/?LinkId=323507 10 月 9 日更新。有一个 https 错误:sdksetup 链接是https://go.microsoft.com/fwlink/p/?LinkId=323507

"Save link as" should help. “将链接另存为”应该会有所帮助。

Another way (worked for 2015) is open "Install/remove programs" (Apps & features), find Visual Studio, select Modify.另一种方法(适用于 2015 年)是打开“安装/删除程序”(应用程序和功能),找到 Visual Studio,选择修改。 In opened window, press Modify, check在打开的窗口中,按修改,检查

  • Languages -> Visual C++ -> Common tools for Visual C++
  • Windows and web development -> Tools for universal windows apps -> Tools (1.4.1) and Windows 10 SDK ([version])
  • Windows and web development -> Tools for universal windows apps -> Windows 10 SDK ([version])

and install.并安装。 Then right click on solution -> Re-target and it will compile然后右键单击解决方案->重新定位,它将编译

I had win10 SDK and I only had to do retarget and then I stopped getting this error.我有 win10 SDK,我只需要重新定位,然后我就不再收到这个错误了。 The idea was that the project needs to upgrade its target Windows SDK.这个想法是该项目需要升级其目标 Windows 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.我工作的公司仍然使用VS2015,所以我仍然使用VS2015。 I recently started working on a RPC application using C++ and found the need to download the Win32 Templates.我最近开始使用 C++ 开发 RPC 应用程序,发现需要下载 Win32 模板。 Like many others I was having this "SDK 8.1 was not found" issue.像许多其他人一样,我遇到了“找不到 SDK 8.1”的问题。 i took the following corrective actions with no luck.我采取了以下纠正措施,但没有运气。

  • I found the SDK through Micrsoft at the following link https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/ as referenced above and downloaded it.我通过 Micrsoft 在以下链接https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/找到了 SDK,如上所述并下载了它。
  • I located my VS2015 install in Apps & Features and ran the repair.我在应用程序和功能中找到了我的 VS2015 安装并进行了修复。
  • I completely uninstalled my VS2015 and reinstalled it.我完全卸载了我的 VS2015 并重新安装了它。
  • I attempted to manually point my console app "Executable" and "Include" directories to the C:\\Program Files (x86)\\Microsoft SDKs\\Windows Kits\\8.1 and C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v8.1A\\bin\\NETFX 4.5.1 Tools.我试图手动将我的控制台应用程序“可执行文件”和“包含”目录指向 C:\\Program Files (x86)\\Microsoft SDKs\\Windows Kits\\8.1 和 C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v8 .1A\\bin\\NETFX 4.5.1 工具。

None of the attempts above corrected the issue for me...上面的尝试都没有为我纠正这个问题......

I then found this article on social 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然后我在社交 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

Finally what resolved the issue for me was:最后为我解决问题的是:

  • Uninstalling and reinstalling VS2015.卸载并重新安装VS2015。
  • Locating my installed "Windows Software Development Kit for Windows 8.1" and running the repair.找到我安装的“适用于 Windows 8.1 的 Windows 软件开发工具包”并运行修复。
  • Checked my "C:\\Program Files (x86)\\Microsoft SDKs\\Windows Kits\\8.1" to verify the "DesignTime" folder was in fact there.检查我的“C:\\Program Files (x86)\\Microsoft SDKs\\Windows Kits\\8.1”以验证“DesignTime”文件夹确实存在。
  • Opened VS created a Win32 Console application and comiled with no errors or issues打开 VS 创建了一个 Win32 控制台应用程序并且编译没有错误或问题

I hope this saves anyone else from almost 3 full days of frustration and loss of productivity.我希望这能让其他人免于近 3 天的沮丧和生产力损失。

  • Install the required version of Windows SDK or change the SDK version in the project property pages安装所需版本的 Windows SDK 或在项目属性页中更改 SDK 版本

    or或者

  • by right-clicking the solution and selecting "Retarget solution"通过右键单击解决方案并选择“重定向解决方案”

If you do visual studio guide, you will resolve the problem.如果你做visual studio guide,你会解决这个问题。

Grep the folder tree's *.vcxproj files. Grep 文件夹树的*.vcxproj文件。 Replace <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> with <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> or whatever SDK version you get when you update one of the projects.<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>替换为<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>或更新项目之一时获得的任何 SDK 版本。

对我来说,项目属性设置 General->Target Platform -> Change Windows 8.1 to Windows 10 解决了这个问题

I encountered this issue while trying to build an npm project.我在尝试构建 npm 项目时遇到了这个问题。 It was failing to install a node-sass package and this was the error it was printing.它未能安装 node-sass 包,这是它正在打印的错误。 I solved it by setting my npm proxy correctly so that i我通过正确设置我的 npm 代理解决了这个问题,以便我

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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