Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set Visual Studio to show a stack trace for first chance exceptions?

Right now, it just shows:

A first chance exception of type 'System.ArgumentException' occurred in Microsoft.Stubs.VsPackage.dll

Is there a way I can get it to include a partial stack trace with the exception message without having to break into the debugger?

like image 327
Sam Harwell Avatar asked Feb 03 '10 21:02

Sam Harwell


People also ask

How do I enable First chance exceptions in Visual Studio?

In Visual Studio to enable 1st chance exceptions we can open the exceptions window and check the throw CLR Exception chekbox. There is a Common Language Runtime Exception Thown checkbox that we can check; then click OK.

How do I show exceptions in Visual Studio?

With a solution open in Visual Studio, use Debug > Windows > Exception Settings to open the Exception Settings window. Provide handlers that respond to the most important exceptions.

How do I get stack trace in Visual Studio?

To open the Call Stack window in Visual Studio, from the Debug menu, choose Windows>Call Stack. To set the local context to a particular row in the stack trace display, select and hold (or double click) the first column of the row.

How do I stop Visual Studio from breaking on exception?

To turn off stop on exceptions press " Ctrl + Alt + E ". This will open the Exceptions window . Untick "Common Language Runtime Exceptions - Thrown". That would prevent it from pausing from within the delegate, but not when it's rethrown on Wait .


1 Answers

Are you seeing this message in the output window or in the exception assistant?

The exception assistant is a little tooltip style window which displays the exception information. If it's the exception assitant you can click on the "View Detail" button and bring up a property grid. One of the properties will be the Stack Trace.

If it's the build window I'm afraid there is no way to have it print out the stack trace information with the exception. You're only option is to enable break on first chance exceptions and manually inspect the value.

like image 148
JaredPar Avatar answered Sep 21 '22 02:09

JaredPar