简体   繁体   English

切换到WPF应用程序的设计视图时,Visual Studio 2008 SP1崩溃的原因

[英]What causes Visual Studio 2008 SP1 to crash when switch to Design View of a WPF application

After developing a WPF application without Source Control, I decided to add the solution to TFS. 在开发没有Source Control的WPF应用程序之后,我决定将解决方案添加到TFS。

After doing so whenever I opened the main window.xaml file in Design View Visual Studio would disappear and the following event would be logged in the Application Event log: 每当我打开设计视图中的主窗口.xaml文件时,Visual Studio将会消失,并在应用程序事件日志中记录以下事件:

.NET Runtime version 2.0.50727.3053 - Fatal Execution Engine Error (7A035E00) (80131506) .NET运行时版本2.0.50727.3053 - 致命执行引擎错误(7A035E00)(80131506)

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp . 有关详细信息,请参阅http://go.microsoft.com/fwlink/events.asp上的“帮助和支持中心”。

The problem was caused by a Visual Studio add-in named, "Power Commands for Visual Studio 2008". 该问题是由名为“Visual Studio 2008的Power Commands”的Visual Studio加载项引起的。

After uninstalling them and restarting Visual Studio, the design view for xaml files began working normally. 卸载它们并重新启动Visual Studio后,xaml文件的设计视图开始正常工作。

Same issue, but without Power Commands installed. 同样的问题,但没有安装Power Commands。 The only workaround I've been able to consistently use is to Clean/Rebuild the solution before opening ANY xaml file. 我能够一直使用的唯一解决方法是在打开任何xaml文件之前清理/重建解决方案。 If you can't get into your solution because the XAML is loading on start up, delete the suo. 如果由于XAML在启动时加载而无法进入解决方案,请删除suo。

If you wish to keep Power Commands for Visual Studio 2008 installed, see this workaround here: 如果您希望安装Visual Studio 2008的Power Commands,请在此处查看此解决方法:

PowerCommands crashing VS2008 SP1 PowerCommands崩溃VS2008 SP1

But basically: 但基本上:

a work around which is a simple modification to the devenv.exe.config file. 解决方法是对devenv.exe.config文件进行简单修改。

This will exist in (64 bit systems) C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\Common7\\IDE 这将存在于(64位系统)C:\\ Program Files(x86)\\ Microsoft Visual Studio 9.0 \\ Common7 \\ IDE中

Or (32 bit systems) C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE 或(32位系统)C:\\ Program Files \\ Microsoft Visual Studio 9.0 \\ Common7 \\ IDE

Add this XML token to the dependentAssembly list. 将此XML标记添加到dependentAssembly列表。 They had me add it after the office one, but im not sure if that matters. 他们让我在办公室之后添加它,但我不确定这是否重要。

<dependentAssembly>
  <assemblyIdentity name="office" publicKeyToken="71e9bce111e9429c" culture="neutral"/>
  <codeBase version="12.0.0.0" href="PrivateAssemblies\Office12\Office.dll"/>
</dependentAssembly>

<!-NEW STUFF-->
<dependentAssembly>
  <assemblyIdentity name="Microsoft.PowerCommands" publicKeyToken="null" culture="neutral"/>

  <!-- For 64-bit systems, uncomment this one
  <codeBase version="1.1.0.0" href="C:\Program Files (x86)\PowerCommands\Microsoft.PowerCommands.dll"/> -->

  <!-- For 32-bit systems, uncomment this one
  <codeBase version="1.1.0.0" href="href="C:\Program Files\PowerCommands\Microsoft.PowerCommands.dll"/> -->

</dependentAssembly>

This worked nicely for me. 这对我很有用。

I just came across an answer that worked in my situation. 我刚刚遇到了一个在我的情况下有效的答案。 Using the ngen utility to delete the native image cache fixed the problem. 使用ngen实用程序删除本机映像缓存修复了问题。 I don't know which image it was exactly, as I did not go through then one at a time, but it worked and I was able to keep PowerCommands! 我不知道它究竟是哪一个图像,因为我没有一次一个地通过,但它起作用了,我能够保持PowerCommands!

The command is: 命令是:

ngen /delete *

For a full recount of my tale I've posted it on my blog , including what I found out about ngen and the native image cache. 有关我的故事的完整重述,我已将其发布在我的博客上 ,包括我发现的有关ngen和本机图像缓存的内容。 I think I still have some more to learn about it, but it's a start. 我想我还有更多要了解它,但这是一个开始。

I didn't have PowerCommands installed, but had the same problem. 我没有安装PowerCommands,但遇到了同样的问题。 Starting in safe mode and deleting any exotic tabs in the toolbox solved the problem (you can start in normal mode afterwards). 从安全模式开始并删除工具箱中的任何异国情调选项卡解决了问题(之后您可以在正常模式下启动)。 This is one of many possible causes of this error, as some Googling will show you. 这是此错误的许多可能原因之一,正如一些谷歌搜索将告诉你。

I had this problem for quite a while. 我有这个问题很长一段时间了。 I never had Power Commands installed, deleting the .suo files and cleaning/rebuilding didn't help. 我从未安装过Power Commands,删除了.suo文件,清理/重建没有帮助。 What fixed it for me was to turn off the auto-population of the toolbox. 修复它对我来说是关闭工具箱的自动填充。 Just go to Tools | 只需转到工具| Options | 选项| Windows Form Designer, then the bottom options is AutoToolboxPopulate which I set to false. Windows窗体设计器,然后底部选项是AutoToolboxPopulate,我设置为false。 Then I reloaded the solution into VS2008 and I was able to open WPF files in either Xaml or designer mode. 然后我将解决方案重新加载到VS2008中,我能够以Xaml或设计器模式打开WPF文件。

I have been experiencing this kind of crashes. 我一直在经历这种崩溃。 Make sure your code behind contains the class of the xaml you are editing (this is by default) 确保你的代码后面包含你正在编辑的xaml的类(这是默认情况下)

There is an hot-fix available from Microsoft: Microsoft Connect . Microsoft提供了一个热修复程序: Microsoft Connect I found this link on this blog . 我在这个博客上找到了这个链接。

This fix solved the problem after a restart for me. 这个修复程序在重启后解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 导致VS 2010 SP1 WPF设计器崩溃的原因是什么? - What causes the VS 2010 SP1 WPF Designer to crash? 有没有办法在Visual Studio 2008中关闭WPF设计图面? - Is there a way to switch off wpf design surface in Visual Studio 2008? Blend 2 sp1中的WPF可视状态管理器 - WPF visual state manager in Blend 2 sp1 Visual Studio 2010 SP1设计时的呈现方式与运行时不同 - Visual Studio 2010 SP1 design time renders differently than runtime 调试技术:在调试WPF应用程序后,Visual Studio 2008会导致致命崩溃 - Debug Techniques: Visual Studio 2008 Process fatal crash after debug of WPF application 在Visual Studio 11中从设计/ xaml窗口切换到代码文件以进行WPF应用程序 - Switch from design/xaml window to code file in visual studio 11 for WPF Application DependencyProperty导致Visual Studio在设计时崩溃 - DependencyProperty causes Visual Studio to crash during design time 使用.Net 2008应用程序自动安装.NET Framework 3.5 SP1 - Automatically install the .NET framework 3.5 SP1 with .Net 2008 application XBAP应用程序中的WPF WebBrowser Control .Net 3.5 SP1和更高版本 - WPF WebBrowser Control .Net 3.5 SP1 and higher in XBAP application 在visual studio 2008中针对silverlight 3破解的XAML设计视图? - XAML design view broken in visual studio 2008 for silverlight 3?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM