编辑XAML导致Visual Studio的设计师崩溃 [英] Editing XAML leads Visual Studio's Designer to crash

查看:885
本文介绍了编辑XAML导致Visual Studio的设计师崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作与Visual Studio 2010 WPF应用程序,使用 Telerik的

I'm working on a WPF application with Visual Studio 2010, using Telerik.

我一直在处理大量的崩溃,每次我使用设计器:单击某个元素,改变其位置,即使更名导致的崩溃,并显示以下异常:

I have been dealing with a lot of crashes everytime I use the designer : clicking on a element, changing its position, even changing its name leads to a crash, and displays the following exception :

System.ArgumentNullException
Value cannot be null.
   to System.RuntimeType.MakeGenericType(Type[] instantiation)
   to Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkUtil.GetRuntimeType(Type type)
   to Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkType.TryGetRuntimeType()
   to Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkUtil.EnsureRuntimeType(Type type)
   to Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkProvider.GetRuntimeType(Type reflectionType)
[...]






我尝试了以下几件事:


I tried the following things :


  • 卸载并重新Telerik的;

  • 卸载并重新安装.NET 4.0;

  • 卸载并重新安装Visual Studio中。

这些尝试都没有奏效。

今天上午,我注意到,设计师并没有坠毁一切,我恍然大悟:设计师崩溃的我开或编辑XAML

This morning, I noticed that the designer didn't crashed at all, and I understood why : the designer crashes when I have opened or edited XAML.

打开XAML后,Visual Studio将开始冻结和设计师崩溃每次我尝试点击的东西。如果我关闭Visual Studio和构建解决方案(的无需打开XAML 的),一切工作正常与设计师。

After opening XAML, Visual Studio begin to freeze and the designer crashes everytime I try to click something. If I close Visual Studio and Build the solution (without opening XAML), everything works fine with the designer.

我的猜测是,出了什么错了,当Visual Studio中尝试转换 XAML代码图形元素在设计师,只有在那个方向。

My guess is that something goes wrong when Visual Studio tries to "convert" XAML code to graphical elements in the designer, and only in that direction.

问题的:你有没有尝试这种事情?有你的为什么 modifiying XAML导致崩溃,如何解决呢?

Question : Have you ever experimented this kind of thing ? Have you any idea of why modifiying XAML causes crashes and how to solve it ?

感谢您提前。


  • 调试的可视化后进行attemps Studio实例设计器中打开时本身。从而导致了 ArgumentNullException 的方法 GetRuntimeTime 。我已经能够看到.NET代码,但我无法确定问题的根源。请参见下面的完整的堆栈跟踪:

  • Debug the Visual Studio instance itself when the designer opens. The method which leads to the ArgumentNullException is GetRuntimeTime. I've been able to see the .NET code but I couldn't determine the source of the problem. See the full stack trace below :

在这里输入的形象描述

此外,这是确切的行发生错误和异常的详细信息。请注意,该文件是 VSIsolationProviderService.cs 和我能看到源感谢 .net反射对象浏览器

Additionally, this is the exact line where the error occurs and the exception details. Note that the file is VSIsolationProviderService.cs and that I am able to see the source thanks to the .NET Reflector Object Browser.

  Message=Value cannot be null.
  Source=mscorlib
  StackTrace:
       to System.RuntimeType.MakeGenericType(Type[] instantiation)
  InnerException: null

最后,局部变量检查在异常的时刻显示以下对象:

Finally, the Local Variables inspector at the moment of the Exception shows the following object :

结束:


  • 的值 this._targetFrameworkProvider 在哪里发生异常的线路如下。

  • The value of this._targetFrameworkProvider at the line where the exception occurs is below.

推荐答案

我想,最好的办法是进行调试的Visual Studio!

I guess, your best bet is to debug Visual Studio!


  • 运行Visual Studio的(例如#1)并装载您的解决方案

  • 运行的第二个实例视觉工作室(#2)

  • 从实例#2去,调试 - >附加到流程 - >选择devenv.exe的(例如#1,请务必选择托管调试)

  • 然后选择调试 - >异常,按查找..并搜索System.ArgumentNull,然后选中时抛出

  • 转至实例#1,负荷您在设计视图,这将引发实例#2一个破发点,它应该告诉你一个完整的堆栈跟踪。这些信息应该足以识别有问题的控制/组件。

  • Run Visual Studio (instance #1) and load your solution
  • Run a 2nd instance of Visual studio (#2)
  • From instance #2 go, Debug->Attach to process->Select devenv.exe (instance #1, make sure to select Managed debugging)
  • Then select Debug->Exception, press "Find.." and search for System.ArgumentNull then check "Thrown"
  • Go to instance #1, load your view in the designer, this should trigger a break point in instance #2 and it should show you a full stack trace. This information should be enough to identify the offending control/component..

这篇关于编辑XAML导致Visual Studio的设计师崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆