3
  • Installed Windows 8 Consumer Preview
  • Installed Visual Studio 2010 Premium
  • Installed Visual Studio 11 Ultimate

Everything installed without any errors.

I created a new Windows 8 Metro app using Visual Studio 11 and have no issues viewing xaml in VS 11 designer. If I view it in Blend For Visual Studio 11 a propup with error:

The project 'TestApp.csproj' could not be opened. The imported project 'C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v11\Microsoft.Windows.UI.Xaml.CSharp.Targets' was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. c:\Users\testuser\Documents\Visual Studio 11\Projects\TestApp\testApp.csproj

Also if I create a Windows Metro style project(any of the templates) in Blend For Visual Studio 11 it shows an empty solution after it's done. When I look at the directory of where it suppose to create it I only see the project files but no solution.

Has anyone else had these issues?

Now the only question is how

--Comment 1--

No, path C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml**v11**\Microsoft.Windows.UI.Xaml.CSharp.Targets doesn't exist. The path on the file system is C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml**v11.0**\Microsoft.Windows.UI.Xaml.CSharp.Targets

When I look at the project file this is what I see:

<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' ">
    <VisualStudioVersion>11.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />

The project file seems to be telling it the correct location so I'm not sure why it's trying to look in the wrong path?

--End Of Comment 1--

2
  • Is that the exact error? The name of the targets file includes "CShar", which should presumably be "CSharp". If you look in that folder, do the targets files exist there? Mar 18, 2012 at 23:32
  • So no one else is having this issue? Mar 20, 2012 at 17:52

1 Answer 1

12

Try this workaround from the known issues list:

1.3.3.35 Blend cannot create projects for Metro style apps built using HTML when Visual Studio 2010 is installed after Visual Studio 11 Beta When Visual Studio 2010 is installed after Visual Studio 11 Beta, the installation changes an environment variable to a variable that is incompatible with Blend.

(emphasis added)

To resolve this issue:

To work around this issue, do the following:

  1. Right-click Computer, and then click Properties.
  2. Click Advanced Properties.
  3. In the System Properties dialog box, on the Advanced tab, click Environment Variables. Environmental Variables
  4. Under System Variables, click New.
  5. Under Variable name, type: VisualStudioVersion.
  6. Under Value, type: 11.0.
    Settings
  7. Click OK.

For Windows 8, to get to the environmental variables:

  1. Do a search for Advanced System Settings
  2. Make sure you have Settings selected on the right hand side
  3. Select the View advanced system settings option

Windows 8

1
  • Thanks, helping bring this up in the search results May 10, 2012 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.