1

I try and open a XAML file in a silverlight project, VS crashes.

I can create a new Silverlight project, and open XAML files in that new project no problem. However even if I create a new XAML file in my existing project VS still crashes, so my hunch is that it's not the content of the XAML, but rather something else in the project.

Any suggestions on how to troubleshoot this further before I go down the laborious task of starting with an empty but working project, and adding the bits of the existing project until it crashes.

Ralph Shillington
  • 20,718
  • 23
  • 91
  • 154

4 Answers4

2

As it turns out my DesignTime ViewModel data was the source of the problem. I inject a design-time repository that populates various collections with suitable design-time data. After a bit of refactoring that was done around the same time as the Silverlight update was applied, I messed up one of the property setters. The validator throw the exception and these caused VS to crash.

In the end I debugged this by starting a second instance of Visual Studio attaching the debugger to the first instance, and setting a bunch of breakpoints in my view model locator and design-time repository.

I debated removing this question, but decided to leave it up, with this answer as I suspect I'm not the first person to have VS crash for no apparent reason.

Ralph Shillington
  • 20,718
  • 23
  • 91
  • 154
1

I just had this problem and I solved it this way :

launch the project in debug mode, try then to look at you xaml.

It worked, after closing the program everything was alright.

It's quick and safe. (you don't delete any hidden files...) Maybe it will work for you.

1

Deleting the ngen cache worked for me. See What causes Visual Studio 2008 SP1 to crash when switch to Design View of a WPF application

Community
  • 1
  • 1
AlSki
  • 6,868
  • 1
  • 26
  • 39
0

Try deleting the .suo file. You will find it where your solution file is and it will have the same name as the solution file i.e.

MySolution.sln
MySolution.suo

Rus
  • 1,827
  • 1
  • 21
  • 32
  • As it turns out I don't have an suo file --- although I'm not sure what deleting that file would accomplish anyway. – Ralph Shillington Mar 08 '11 at 18:11
  • .Suo files can be hidden, you will need to make all files visible. The Suo file stores user specific settings and although it seems unlikely I have seen situations where the suo file has caused issues. – Rus Mar 08 '11 at 20:59