Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find first chance exceptions from output window

Tags:

c#

exception

I'm getting first chance exceptions in my output window in debug mode. How do I find where they're coming from? Do I have to put a breakpoint in every catch?

A first chance exception of type 'System.IO.IOException' occurred in mscorlib.dll

like image 287
tsilb Avatar asked May 31 '11 12:05

tsilb


People also ask

How do I find exceptions in Windows?

Click Start and select Control Panel. Click Windows Firewall. Click the Exceptions tab.

How do I catch 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. If you need to know how to add handlers for exceptions, see Fix bugs by writing better C# code.

What is first chance exception?

first-chance exception (plural first-chance exceptions) (computing) An exception (error condition) when handled by a debugger, such that the programmer has the first chance to study it; such an exception would otherwise proceed to a handler or (in its absence) crash the program.

How do I fix unhandled exception in Visual Studio?

In Visual Studio, when exceptions are thrown or end up unhandled, the debugger can help you debug these by breaking just like it breaks when a breakpoint is hit.


1 Answers

Go to Debug, Exceptions (Ctrl + D, E), and check the types you're interested in.
This dialog tells the debugger to break whenever an exception is thrown, regardless of whether it's caught.

like image 86
SLaks Avatar answered Oct 01 '22 02:10

SLaks