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 2010, but in a different registry location. You want to apply the same edits, but the location is:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft SDKs\Windows
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 v7.0, but none for v7.1) or if it is by design, but everything seems to compile correctly after my changes.