编辑XAML代码时,Visual Studio 2008会冻结

时间:2023-01-22 01:31:53

A few times a day my VS2008 SP1 freezes if I edit XAML code. It just got stuck and I have to kill the process. It seems to be a problem with the IntelliSense or the spell-checking or whatever process is going on while I edit code. The problem is very apparent if I copy+paste some code. Even if it is just one word. Many times VS2008 adds some additional commands in the code and messes things up completely.

如果我编辑XAML代码,我的VS2008 SP1每天会冻结几次。它只是卡住了我必须杀死这个过程。在编辑代码时,智能感知或拼写检查或正在进行的任何过程似乎都存在问题。如果我复制+粘贴一些代码,问题就很明显了。即使它只是一个字。很多时候VS2008在代码中添加了一些额外的命令并完全搞砸了。

This never happened with C# code only with XAML it does get stuck.

这种情况从未发生在C#代码中,只有XAML才会卡住。

One more thing: It seems the problem only occurs when I edit control templates. I added a few control templates from the MSDN pages to my project. When I edit them - even doing simple things like changing brush colors - Visual Studio freezes (sometimes). So it seems it's not a general XAML problem it happens with control templates only.

还有一件事:似乎问题只发生在我编辑控件模板时。我从MSDN页面添加了一些控件模板到我的项目。当我编辑它们时 - 甚至做一些简单的事情,比如更改画笔颜色 - Visual Studio会冻结(有时)。因此,它似乎不仅仅是控件模板发生的一般XAML问题。

2 个解决方案

#1


You could try this update: Installing DExplorer after VS 2008 breaks xaml intellisense

您可以尝试此更新:在VS 2008打破xaml intellisense后安装DExplorer

EDIT: You could try closing the Properties window when editing XAML, it helped me before with ASP.NET.

编辑:您可以尝试在编辑XAML时关闭“属性”窗口,它在使用ASP.NET之前帮助了我。

Some other links:

其他一些链接:

#2


After having this problem and hunting around on the interwebs I found this vsnet-crashes-when-editing-xaml

在遇到这个问题并在互联网上狩猎后,我发现了这个vsnet-crashes-when-editing-xaml

Which said, in summary, if you edit a xaml resource while something that uses said resource is open in a designer, then you'll be sorry.

总而言之,如果你编辑一个xaml资源,而使用所述资源的东西在设计师中打开,那么你会后悔的。

So you can avoid the problem by

所以你可以避免这个问题

  • Closing the other designer windows;
  • 关闭其他设计师窗口;

  • Installing hotfix KB958017.
  • 安装修补程序KB958017。

#1


You could try this update: Installing DExplorer after VS 2008 breaks xaml intellisense

您可以尝试此更新:在VS 2008打破xaml intellisense后安装DExplorer

EDIT: You could try closing the Properties window when editing XAML, it helped me before with ASP.NET.

编辑:您可以尝试在编辑XAML时关闭“属性”窗口,它在使用ASP.NET之前帮助了我。

Some other links:

其他一些链接:

#2


After having this problem and hunting around on the interwebs I found this vsnet-crashes-when-editing-xaml

在遇到这个问题并在互联网上狩猎后,我发现了这个vsnet-crashes-when-editing-xaml

Which said, in summary, if you edit a xaml resource while something that uses said resource is open in a designer, then you'll be sorry.

总而言之,如果你编辑一个xaml资源,而使用所述资源的东西在设计师中打开,那么你会后悔的。

So you can avoid the problem by

所以你可以避免这个问题

  • Closing the other designer windows;
  • 关闭其他设计师窗口;

  • Installing hotfix KB958017.
  • 安装修补程序KB958017。