The Windows SDK Configuration Tool sets which version of Windows SDK headers, libraries and tools you want to build with in Visual Studio. The tool shipped with the Windows SDK for Server 2008, and bugs have since been discovered that affect different scenarios. Here’s how to get the tool working in your scenario. Instructions are different depending on which Visual Studio release and SKU you’re using. This post addresses the version of the SDK Configuration Tool that shipped in the Windows SDK for Server 2008.
Visual Studio 2008 Retail:
First, the Visual Studio 2008 SP1 patch breaks the tool. If you’ve installed the patch on VS 2008 Retail (non-Express versions), you need to first complete the workaround explained in this blog post. Read the blog post Integrating Windows SDK and VS with new SDK Configuration tool if you want background on the tool. Next, the GUI version of the tool looks like it works but it doesn’t really change the paths. This will affect you even if you haven’t installed the SP1 patch. You have to use the tool at the command line, following these steps.
To use the Visual Studio command line build environment:
1. Launch Visual Studio 2008 command prompt.
2. CD to the directory where the SDK Configuration Tool is located (by default, C:\Program Files\Microsoft SDKs\Windows\v6.1\Setup).
3. Run the SDK Configuration Tool, specifying which SDK version to make current: (Type: WindowsSdkVer.exe -version:v6.1)
4. You can now build at the command line using version v6.1 of the SDK, which is the Windows SDK for Server 2008. You can switch back to v6.0a to use the SDK components that shipped in Visual Studio 2008.
5. If you’d like to build in the Visual Studio IDE, while still in the Visual Studio command window, type: devenv /useenv
6. The SDK version you have set as “current” will remain the current SDK for the current Visual Studio session.
To use the Visual Studio IDE:
Follow the instructions above to launch the tool from the command line build environment then switch to the IDE, or use workaround # 2 in this blog post to update HKEY_CURRENT_USER to point to the version of the SDK that you wish to build with. This workaround ‘permanently’ sets the SDK version you have set as “current.” It will remain the current SDK until it is changed again through the registry. (Running Repair on Visual Studio or the Windows SDK can change this value in the registry.)
Visual Studio 2008 Express:
Read the blog post Using Visual C++ 2008 Express with the Windows SDK if you need background. The only bug on Express is that the GUI version of the tool doesn’t work. (The Visual Studio 2008 SP1 Patch does not affect Express versions.) You have to use the command line version of the tool to set the ‘current SDK’, but then you can use VS 2008 Express in the IDE or command line mode.
1. Launch the Windows SDK Command Window (Start, All Programs, Microsoft Windows SDK v6.1, Command Window)
2. CD to \Program Files\Microsoft\Windows\v6.1\Setup>
3. Type: WindowsSdkVer.exe -version:v6.1
This command will set the Windows SDK for Windows Server 2008 (v 6.1) as the “current” SDK for Visual Studio to use. Use ‘-version:v6.1’ for the Windows Server 2008 SDK content. Use ‘-version:v6.0A’ for the Visual Studio 2008 content.
Visual Studio 2005 Retail:
On VS 2005, the tool works by overwriting your VCProjectEngine.dll.config file and a bug causes it to do so without warning, so back this file up first if you have custom settings you want to keep. Read the blog post Integrating Windows SDK and VS with new SDK Configuration tool for background on the tool. The tool works well in either GUI or command line version with VS 2005, with the exception of one scenario. The configuration tool requires that VS 2005 C++ has been run at least once. Intermittently, users will get an error that “VS 2005 must be run at least once…” even though VS2005 has already been run. This seems to affect some users that have installed VS 2005 as Administrator but are running as Limited User. You can probably get it working by running VS as an Admin.
Visual Studio 2005 Express:
The tool is not supported on Visual Studio 2005 Express. Upgrade to Visual Studio 2008 Express or set your header, library and tool paths manually.
Program Manager, Windows SDK Team
The MSDN Windows SDK Developer Center is the place to find resources and links to Windows SDK products, release notes, technical articles, and more.