I had a little accident last week and needed a computer fast. The only thing I could get was a computer with Windows 8 Consumer Preview already installed. That was actually no problem as I’m currently working on a Windows 8 project. Problem is that I also work on a number of Windows Phone projects.
Apart from the XNA installation problem, the WP SDK was no problem to install and all seemed fine, until I opened up the Windows 8 project in Blend… or actually tried to open it up.
Whatever I did I was greeted with the same message:
I tried a number of (time consuming) things here, repair of VS11, uninstall of Blend 5 beta and reinstall and in the end a complete reinstall (as in uninstall/install) of Visual Studio 11. No luck.
The I actually started to read the error message:
… The imported project "C:Program Files (x86)MSBuildMicrosoftWindowsXamlv10.0Microsoft.Windows.UI.Xaml.CSharp.targets" was not found. Confirm that the path in the <import> declaration is correct, and that the file exists on disk. …
First thought was to check the project file but why would I need to change that, it worked before. Nope, the problem is obviously that the MSBuild targets are not found where it’s supposed to be. Second try was to copy the actual files to the v10.0 path. That didn’t do it either, led to a couple of new problems instead.
Finally I found the problem after some experimenting (remember, this is Windows 8, searching the net will get you about 3 hits – none of them relevant). The solution was to add an Environment variable to the system to get it running.
- Right click on Computer, select Properties
- Select Advanced system settings
- Down to the right you find Environment variables (they get a bit harder to find for each version of Windows…)
- Add the System variable VisualStudioVersion with a value of 11.0 and that’s it
Now open up Blend 5 and load your Windows 8 project!