It seems reasonable that the solution Gavin Pugh gave would fix the problem, though I didn’t try it. I too ran into this problem after uninstalling the Developer Preview of VS11. I think I know what is really wrong though.
Mladen Jankovic was on the right track. One of the follow two (necessary) registry keys was missing on my machine:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0
- Key Name:
VCTargetsPath
- Type:
REG_SZ
- Value:
$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\
- Key Name:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\4.0
- Key Name:
VCTargetsPath
- Type:
REG_SZ
- Value:
$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\
- Key Name:
(You can edit registry keys in Windows by typing +R+regedit+Enter)
For me, the second value I listed above was the one that was missing. After I added it, I was able to work with my project again.