Blend For Visual Studio 11 get an error

隐身守侯 提交于 2020-01-14 18:47:30

问题


  • 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--


回答1:


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.

  4. Under System Variables, click New.
  5. Under Variable name, type: VisualStudioVersion.
  6. Under Value, type: 11.0.

  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



来源:https://stackoverflow.com/questions/9760643/blend-for-visual-studio-11-get-an-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!