切换 VS2010 以使用 Windows 7.1 SDK
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4095009/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Switching VS2010 to use Windows 7.1 SDK
提问by
I've used VS2008 on my development machine for some years now, with windows SDK v7.1.
我已经在我的开发机器上使用 VS2008 多年了,使用 windows SDK v7.1。
I've installed VS2010, and it's using the Windows SDK v7.0a, but I need it to use the Windows 7.1 SDK (which I had installed prior to installing VS2010).
我已经安装了 VS2010,它使用的是 Windows SDK v7.0a,但是我需要它来使用 Windows 7.1 SDK(我在安装 VS2010 之前已经安装了它)。
When I run the Windows SDK 7.1 configuration tool, to switch the Windows SDK in use, the tool updates for VS2008, but not for VS2010. The message it reports is:
当我运行Windows SDK 7.1 配置工具时,为了切换正在使用的Windows SDK,该工具会针对VS2008 进行更新,但不会针对VS2010 进行更新。它报告的消息是:
"The Windows SDK Configuration Tool has successfully set Windows SDK version v7.1 as the current version for Visual Studio 2008"
The configuration tool is installed with the Windows 7.1 SDK and is found here:
配置工具随 Windows 7.1 SDK 一起安装,可在此处找到:
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Setup\WindowsSdkVer.exe"
VS2010 continues to use WSDK 7.0a, which extremely frustrating, as I need to do DirectShow development (so I need to build the baseclasses, which aren't released with 7.0a release of WSDK).
VS2010 继续使用 WSDK 7.0a,这非常令人沮丧,因为我需要进行 DirectShow 开发(因此我需要构建基类,这些基类未随 WSDK 7.0a 版本一起发布)。
Would I be correct in assuming that it's not updating VS2010 settings because VS2010 wasn't installed at the time that I installed Windows 7.1 SDK?
假设它没有更新 VS2010 设置,因为在我安装 Windows 7.1 SDK 时没有安装 VS2010,我是否正确?
Can I fix this manually, or should I uninstall Windows 7.1 SDK, then reinstall it?
我可以手动修复这个问题,还是应该卸载 Windows 7.1 SDK,然后重新安装?
Any other suggestions / workarounds for this?
对此还有其他建议/解决方法吗?
回答by Piotr Dobrogost
For all those using Visual Studio Command PromptI mention you have to modify VCVarsQueryRegistry.bat
file (it's being called (indirectly) by %VSINSTALLDIR%\VC\vcvarsall.bat
) which is placed in %VSINSTALLDIR%\Common7\Tools
folder (typicaly C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools
) by modifying line 26 from
对于所有使用Visual Studio 命令提示符的人,我提到您必须通过修改第 26 行来修改VCVarsQueryRegistry.bat
文件(它被(间接)调用),%VSINSTALLDIR%\VC\vcvarsall.bat
该%VSINSTALLDIR%\Common7\Tools
文件放置在文件夹(典型C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools
)中
@for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A" /v "InstallationFolder"') DO (
to
到
@for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1" /v "InstallationFolder"') DO (
I wish someone from Microsoft explained why WindowsSdkVer.exe
doesn't work for VS 2010...
我希望来自微软的人解释为什么WindowsSdkVer.exe
不适用于 VS 2010 ...
回答by oktalist
In project properties -> Configuration Properties -> General, set Platform Toolkit to WindowsSDK7.1 (or whatever version you want to use). Remember when you do this to select all configurations (release, debug, etc.) and all platforms (win32, x64, etc.) as appropriate. The documentation says you can set this option in the solution properties, but that does not seem to be the case.
在项目属性 -> 配置属性 -> 常规中,将 Platform Toolkit 设置为 WindowsSDK7.1(或您要使用的任何版本)。请记住,执行此操作时要根据需要选择所有配置(发布、调试等)和所有平台(win32、x64 等)。文档说您可以在解决方案属性中设置此选项,但似乎并非如此。
回答by Tuldok89
Take a look at this page guys. This is going to solve your problems -> Building Applications that Use the Windows SDK
看看这个页面的家伙。这将解决您的问题 ->构建使用 Windows SDK 的应用程序