How to get the SDK Configuration Tool to work

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 but has had several problems. Here’s how to get it working in your scenario. Instructions are different depending on which Visual Studio release and SKU you’re using.

Visual Studio 2008 Retail (non-Express):

First, Visual Studio 2008 SP1 breaks the tool. If you’ve installed SP1 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. The GUI version of the tool looks like it works but it doesn’t really change the paths. 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. Read the blog post Integrating Windows SDK and VS with new SDK Configuration tool for background on the tool. The tool works pretty well in GUI or command line version on VS 2005, with the exception of one scenario. Intermittently, users will get an error that “VS 2005 must be run at least once,” even though the app has been run in the past. 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.