views:

838

answers:

4

Visual Studio 2008 has been very stable for months on my computer.

This morning when I double-click on any .xaml file to open it, or even click on the tab of an already opened .xaml file, Visual Studio says "initializing toolbar" in the status bar and then 20 seconds later fully closes the whole application without any error message.

Other files (e.g. .cs class files) I can open fine.

Has anyone experience this or know what I could check/change to be able to use Visual Studio to edit .xaml files again?

MORE INFO: I can also create a new project and create and edit .xaml files fine.

MORE INFO: I can edit .xaml files in other modules (projects) fine.

MORE INFO: Everytime it crashes, this event is registered:

.NET Runtime version 2.0.50727.3053 - Fatal Error in executable module (72555E00) (80131506).

(odd since I have .NET framework 3.5 installed)

MORE INFO: It is only in one module (project) that .xaml files cause Visual Studio to crash. Even creating a new UserControl in that module crashes Visual Studio.

A: 

This sounds very similar to the issue I had when I first installed VS 2008. Unfortunately, after hours of research, I ended up reinstalling the IDE (with my fingers crossed). No problems since then, but it's obviously not the most enjoyable way to solve the problem.

Dustin Hoffman
A: 

I get this occasionally (with .xaml and .resx files) and find that if I delete the solutions .suo file things work fine again.

[The suo file just contains per user settings like recently opened files etc so it's nothing important and will just be recreated when you next open the solution.]

Simon P Stevens
deleted .suo file, tried again, still crashes when opening any .xaml file :-(
Edward Tanguay
Sorry. If you try MS support (depending on how you brought VS), they might have some diagnostic tools to run on your PC to help solve the problem.
Simon P Stevens
+2  A: 

I've been getting the same issue whenever I try to access project settings for a C# project.

Found additional information about this:

Here: http://blog.fryhard.com/archive/2008/11/26/visual-studio-2008-closes-at-build-outlook-2007-add-in.aspx

And here: http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/99e124d0-c5d7-49c0-b1dd-71328f9a6571/

Apparently it's a bug in the core CLR engine that causes the entire CLR to crash if certain types of assemblies are loaded in a certain order.

Most of the time it appears to be directly related to the Visual Studio add-in called PowerCommands - uninstalling PowerCommands will make the problem go away.

And (we hope) it's supposed to be fixed for .Net 4.

Jeff B
Yep, PowerCommands was my problem.
Bermo
A: 

What is likely happening here is that one of the controls referenced directly on indirectly in your designer is stack overflowing during the designer process. Because the designer is hosted in process a stack overflow by one of the components will take down the designer and VS.

Try attaching a debugger to VS, break on first chance StackOverflow Exceptions and open the designer.

JaredPar