This article describes the use of the Windows SDK Configuration tool, which is included in the Windows SDK for Windows Server 2008 and .NET Framework 3.5 and works with Visual Studio 2005 and Visual Studio 2008, including Visual Studio 2008 Express SKUs.

A serious bug has been discovered with the Windows SDK Configuration Tool.  This bug is not apparent as the tool appears to work correctly.  Please read the blog post WinSDK bug notification: SDK Config Tool appears to work but fails, to learn more about the issue and find workaround steps.

 

What is the Windows SDK Configuration tool for?

The Windows SDK for Windows Server 2008 and .NET Framework 3.5, released in February, 2008, includes a new tool to help you develop more easily with Visual Studio.  You can use this tool to set which version of Windows SDK headers, libraries and tools you want to build with in Visual Studio.

 

 The Visual Studio 2008 editions are seamlessly integrated with the Windows SDK.  VS2008 editions include the same Vista RTM headers and libraries that shipped in the Microsoft Windows Software Development Kit Update for Windows Vista released in March, 2007. (The SDK tools in VS2008 are more recent.)  You can use these integrated Windows Vista headers and libraries right out of the box with Visual Studio 2008.   If you want to use the content in another Windows SDK, the SDK Configuration Tool will allow you to do just that, by setting which SDK is the ‘current’ SDK to build with. 

 

Updating the Windows SDK Content in Visual C++2008

You can build Win32 applications right out of the box with the Vista RTM SDK components that are embedded in Visual Studio 2008.  It’s also easy to switch to the more recent components that ship with the Windows SDK for Windows Server 2008 and .NET Framework 3.5 by installing this SDK on your computer.  If you install the SDK after you installed VS, you are ready to develop with the headers, libraries and tools in the SDK for Windows Server 2008.  If you installed the Windows Server 2008 SDK before you install Visual Studio, you will need to use the SDK Configuration Tool to set the directories. 

sdkconfigTool - Share on Ovi

Windows SDK headers, libraries and tools 

After installing the Windows SDK for Windows Server 2008 and Visual Studio 2008 (any SKU), you’ll have two sets of SDK resources installed by default to C:\Program Files\Microsoft SDKs\Windows\:

·         \v6.0A contains the SDK resources installed by Visual Studio 2008

·         \v6.1 contains the SDK resources installed by the Windows SDK for Windows Server 2008

 Directory - Share on Ovi

Visual Studio 2008 will point to v6.0A headers, libraries and tools, which installed with VS by default.  Use the SDK Configuration Tool to update the Visual C++ directories to point to the v6.1 headers, libraries and tools that shipped with the Windows SDK for Server 2008.

 

How does the SDK Configuration Tool work?

The tool works by altering the Visual Studio 2008 directories through a registry key setting.  (The tool works differently with Visual Studio 2005. This will be covered in a future post.)

 

·         On an X86 computer: HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows

·         On an X64 or IA64 computer: HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows

The settings “CurrentVersion” and "CurrentInstallFolder" refer to the version and location of the registered Windows SDK headers, libraries and tools. These settings get updated during Windows SDK installation or when the Windows SDK Configuration Tool is used to choose which Windows SDK content users want to use with Visual Studio 2008.  

 

SDK registry settings used by Visual Studio 2008 - Share on Ovi

 

SubKey

Window SDK Version

V6.0

Windows SDK for Windows Vista and Windows SDK for Windows Vista Update

V6.0A

Windows SDK Visual Studio Components

V6.1

Windows SDK for Windows Server 2008

 

Visual Studio 2008 looks at this key to determine how to set the following directories:

 

·         Visual Studio Library Directory sets the paths to use when searching for library files while building a VC++ project.  It corresponds to environment variable LIB. 

·         The Visual Studio Include Directory sets the paths to use when searching for include files while building a VC++ project.  It corresponds to environment variable INCLUDE. 

·         The Visual Studio Executables Directory sets the path to use when searching for executable files while building a VC++ project.  It corresponds to environment variable PATH.

The VC++ 2008 Library, Include and Tool path are set upon install to the Windows SDK content that ships embedded with Visual Studio 2008.  If you want to change these paths you can do so manually through Visual Studio, or use the SDK Configuration Tool to set these directories. 

 

  VCInclude Dir - Share on Ovi

The SDK Configuration Tool has a GUI interface that works with the Visual Studio Retail (non-Express) SKUs, and a command line interface that works with either the VS Retail or Express SKUs.  (See Using Visual C++ 2008 Express with the Windows SDK  for more information on working with Visual Studio Express.)

 

How to use the SDK Configuration Tool in GUI mode

To launch the SDK Configuration Tool GUI interface, go to Start, All Programs, Microsoft Windows SDK v6.1, Visual Studio Registration, Windows SDK Configuration Tool.

launchSDKconfig - Share on Ovi

Use the drop box to pick which version of SDK content you want to integrate with Visual Studio, and click Make Current. 

 sdkconfigTool - Share on Ovi

How to use the SDK Configuration Tool at the command line

The SDK Configuration Tool can be used with either the GUI or command line interfaces with Visual Studio 2005 Retail or Visual Studio 2008.  The tool can only be used at the command line for Visual Studio 2008 Express SKUs. (See Using Visual C++ 2008 Express with the Windows SDK.)

 

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 will set the Windows SDK for Windows Server 2008 (v 6.1) as the “current” SDK for Visual Studio to use for headers, libraries and tools. 

SDKcmdWindow - Share on Ovi

CMDwinConfirm - Share on Ovi

How to validate that Visual Studio Directories were successfully updated

 

Open the Visual Studio command window and check the PATH to see if the v6.1 directory has been added:

1.            Start, All Programs, Visual C++ Express Edition 9.0, Visual Studio Tools, Visual Studio 2008 Command Prompt

2.           At the prompt, type: PATH

verify - Share on Ovi

How to Switch back to the SDK content that shipped ‘in the box’ with Visual Studio 2008

To restore the default directories, use the SDK Configuration Tool at the command line to make the v6.0A directories ‘current.’

 

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.0A

 Troubleshooting:

 

After Visual Studio Repair, environment variables are reset.  If Visual Studio is Repaired (through Add/Remove Programs), the environment variables will point back to the default VS content.  You will need to use the SDK Configuration tool if you want to point to the content in the Windows Server 2008 SDK.

 

After Windows SDK Repair, environment variables are reset. If the Windows SDK is ‘Repaired’ (through Add/Remove Programs), the environment variables will point to Windows SDK content.  You will need to use the SDK Configuration tool if you want to point to the content that shipped with Visual Studio 2008.

 

Please send feedback on this tool. 

 

The MSDN Windows SDK Developer Center is the place to find resources and links to Windows SDK products, release notes, technical articles, and more.