Hidden Swallowed Exceptions

I just configured my development environment to be able to debug into the .NET Framework source code that was just made available (see Shawn Burke's post for how to do this -- it's rad!). One of the things you have to do for this to work in Visual Studio is to uncheck the "Enable Just My Code" in the debugging options.  This turns out to have an interesting side consequence: exceptions that are swallowed inside Microsoft .dlls may suddenly start appearing in your output screen.  This is exactly what started happening to me when debugging today. I kept seeing the following in my application: A first chance exception of type 'System.Deployment.Application.InvalidDeploymentException' occurred in System.Deployment.dll. After much head scratching, I realized that this exception wasn't happening in my code, but was being swallowed somewhere deep in the framework.  I wonder what other swallowed exceptions people may start seeing as a result of turning off the "Enable Just My Code" option in Visual Studio.

posted on Jan 21st, 2008 | Permalink | Comments (1)

1 Comment »

  1. This is a first chance exception, which means the debugger will notify you when the exception is raised rather than when it's unhandled. This has nothing to do with Just my Code, it has to do with breaking on exception throwing. To change that behavior, use the Exception window (CTRL+D, E or CTRL ALT D on most vs installs)

    Comment by Sebastien Lambla - January 23, 2008 @ 7:20 AM

Leave a comment