wpf Visual Studio XAML 设计器未加载

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22406822/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 11:13:27  来源:igfitidea点击:

visual studio XAML designer not loading

c#wpfxamlvisual-studio-2012windows-phone-8

提问by Reza Shayestehpour

I'm developing Windows phone apps on my Mac Book Pro Retina (late 2013) on a virtual machine using Parallels 9. I have Visual Studio 2012 and Windows phone 8 SDK installed and everything works fine writing code and testing it on my Lumia phone. The problem is that the XAML designer doesn't load i.e. I get the following error:

我正在使用 Parallels 9 在虚拟机上的 Mac Book Pro Retina(2013 年末)上开发 Windows 手机应用程序。我安装了 Visual Studio 2012 和 Windows phone 8 SDK,一切正常,可以在我的 Lumia 手机上编写代码并进行测试。问题是 XAML 设计器没有加载,即我收到以下错误:

System.InvalidOperationException The document failed to open.

    at Microsoft.Expression.DesignSurface.DesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)

    at Microsoft.Expression.DesignHost.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken)

Next to this error message, which is displayed instead of the designer, there's a button to reload the designer. But when I press it, it takes forever and gets no results.

在显示而不是设计器的此错误消息旁边,有一个用于重新加载设计器的按钮。但是当我按下它时,它需要很长时间并且没有结果。

I have posted my question in the Microsoft forumbut it seems like a ghost town down there.

我已经在 Microsoft论坛上发布了我的问题,但那里似乎是一个鬼城。

回答by user582645

Steps:

脚步:

  1. close all visual studio instances
  2. browse to C:\Users\<>\AppData\Local\Microsoft\VisualStudio\12.0
  3. rename or remove "ComponentModelCache"
  4. restart Visual Studio
  1. 关闭所有 Visual Studio 实例
  2. 浏览到 C:\Users\<>\AppData\Local\Microsoft\VisualStudio\12.0
  3. 重命名或删除“ComponentModelCache”
  4. 重新启动 Visual Studio

回答by DharmaTurtle

I also got an infinitely loading Designer. I solved it by deleting the UserControl and recreating it via source control.

我还得到了一个无限加载的设计器。我通过删除 UserControl 并通过源代码管理重新创建它来解决它。