Reputation: 4854
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:
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
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
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
Reputation: 28423
Open a new project in VS (C# or VB; something other than Silverlight/Web)
Project Properties -> Debug -> Start External program: (Select your VS exe)
Save
Type: Ctrl+Alt+E
when the Exceptions window pops up, check: [x] Thrown Common language runtime exceptions.
Click Ok
Run the project which will start a new instance of VS2010.
Use this new instance to open the solution you wish to debug.
Execute your solution... you should see the exception.
Upvotes: 2
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
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