Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WindowsSdkDir is not set correctly in Visual Studio 2010

Tags:

So i've been searching this for quite a while now, to no avail! Has anyone figured out how to change the $(WindowsSdkDir) macro in visual studio 2010, to make it point to whatever version of the windows sdk they would like?

Hopefully this can be a reference to all those who will search for this after me. :)

like image 880
Tamer Avatar asked Aug 30 '10 08:08

Tamer


People also ask

Where is Windowssdk_includepath defined?

Common. props in folder C:\Program Files (x86)\MSBuild\Microsoft.


2 Answers

I ran into a similar problem when trying to setup a fresh system using VS2010 and the Windows 7 / .NET 4 SDK (v7.1). The solution turns out to be similar to the one for Visual Studio 2008, but in a different registry location. You want to apply the same edits, but the location is

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows

for 32b Windows and

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows

for 64b Windows.

Also, depending on your installation (for both 32b and 64b versions of Windows), you may also need to change the corresponding key in the HKEY_CURRENT_USER tree.

You want to edit the following keys to point to the SDK version you want to use:

CurrentInstallFolder
CurrentVersion
ProductVersion

After making the changes, I restarted Visual Studio and it used the appropriate SDK version. I don't know if this is a bug in the SDK installer (one was logged for the WindowsSDK v6.1, but none for v7.1) or if it is by design, but everything seems to compile correctly after my changes.

Tested for 32b and 64b Windows 7.

like image 118
bsruth Avatar answered Sep 27 '22 21:09

bsruth


To tailor an individual Visual Studio 2010 project to use a specific version of the Windows SDK go to Project | Properties, select the General tab (under Configuration properties) and then set the "Platform Toolset" drop down to point at the SDK you want to use. The WindowsSdkDir macro will change appropriately.

Remember to make this change for all Configurations and all Platforms.

like image 32
Frank Boyne Avatar answered Sep 27 '22 23:09

Frank Boyne