Jakob
Jakob

Reputation: 4854

Project keeps crashing visual studio 2010

I have a project that when i compile it keeps crashing visual studio 2010. It's only that project in the solution, and it seems like it gets compiled, but it crashes.

It's a silverlight c# project

From the SDK command line tool I can run MSBuild, and the project will compile without problems, without crashing vs of course. When building in vs the project also gets compiled (I can see that it has been built when the vs restarts itself), it's just that vs crashes.

How can I debug this issue to resolve it?

---Tried:

  1. resetting the visual studio settings in: Tools -> Import and Export Settings -> reset all settings
  2. Writing out a log with devenv /log, but there are no errors and no warnings
  3. deleting the .suo file

Following Nescio's solution

I get this error just before visual studio crashes:

A StreamWriter was not closed and all buffered data within that StreamWriter was not flushed to the underlying stream. (This was detected when the StreamWriter was finalized with data in its buffer.) A portion of the data was lost. Consider one of calling Close(), Flush(), setting the StreamWriter's AutoFlush property to true, or allocating the StreamWriter with a "using" statement. Stream type: System.IO.FileStream File name: C:\Users\MyUser\AppData\Local\Temp\28e633d3642e4ac28a6ca861274e8b9a\svcutil.log Allocated from: callstack information is not captured by default for performance reasons. Please enable captureAllocatedCallStack config switch for streamWriterBufferedDataLost MDA (refer to MSDN MDA documentation for how to do this).

Upvotes: 3

Views: 3355

Answers (5)

Tomas Voracek
Tomas Voracek

Reputation: 5914

Try these steps:

  • Create new SL app from default template. If VS doesn't crash, then you will know that it is your project causing this. VS/.NET reinstall may help

  • Try installin VS Express. If this also crashes, then maybe VS/.NET files are corrupted.

  • Check EventViewer for errors

  • Try Debug VS with another VS

Upvotes: 1

Nescio
Nescio

Reputation: 28423

This link describes the error message you are seeing...

Unfortunately, given the data you provided, I cannot determine what is causing the crash. Are you using any third party controls? Can you build any other Silverlight applications? Also, it may help if you provide the full exception, including the Stack Trace.

Upvotes: 0

Nescio
Nescio

Reputation: 28423

  1. Open a new project in VS (C# or VB; something other than Silverlight/Web)

  2. Project Properties -> Debug -> Start External program: (Select your VS exe)

  3. Save

  4. Type: Ctrl+Alt+E

  5. when the Exceptions window pops up, check: [x] Thrown Common language runtime exceptions.

  6. Click Ok

  7. Run the project which will start a new instance of VS2010.

  8. Use this new instance to open the solution you wish to debug.

  9. Execute your solution... you should see the exception.

Upvotes: 2

Kevin Pullin
Kevin Pullin

Reputation: 13327

In some cases like this, albeit with VS2005 and VS2008, I've had luck fixing the crash by closing Visual Studio, deleting the '.suo' user options file, and retrying.

Upvotes: 1

jwismar
jwismar

Reputation: 12258

I would try creating a new, empty project, and then add the source files from the original project one at a time until A) the project compiles successfully (which would indicate that there was some setting in the project with a problem), or B) you add a source module that causes the IDE to crash again (which would indicate that there's something in your code that the compiler can't deal with).

Either way, this probably signifies a bug in the IDE - even with invalid code, the IDE is not supposed to crash. I'm guessing that if you can narrow down the cause of the crash - especially if you can make it crash in a project with just one or two files in it - they're going to be happy to have you file a bug report.

Upvotes: 1

Related Questions