Question

I am debugging an asp.net application on iisexpress.exe, I have configured visual studio 2013 to break on user-handled exceptions through the exception settings window but it still does not break when an exception is thrown. When I pause execution I can see on the Intellitrace window that a lot of exceptions were thrown but visual studio didn't break.

Was it helpful?

Solution

Ok, it seems it was because of the "Enable Just My Code" options was selected under

Options->Debugging->General

I don't know why but by default, it is checked. Any ideas? Should I leave it checked/unchecked?

OTHER TIPS

@Navad, how the debugger works is that when you have "Just My Code" enabled, the debugger will only break on First Chance Exceptions (thrown, but handled) in user code. Where the debugger defines user code to be code that is compiled "Debug" and you have symbol files (.pdb's) for, or if the assembly is built by a project that is part of your solution. In general Just My Code is what you likely want, as if you disable it and turn on first chance exceptions you will break on any exceptions that occur even in framework code you don't control. Additionally when it is enabled, if you don't catch the Exception in user code the debugger will break and treat it as if it was unhandled. However if you disable Just My Code, you will break on the exception only if it is truly unhandled. For example some frameworks will catch exceptions so the debugger will only break if you switch it to thrown, because no exceptions in your code actually go unhandled, they are only "User Unhandled".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top