Joan Venge
Joan Venge

Reputation: 331042

Why doesn't Visual Studio 2010 show me a popup and the location where an exception is thrown when my code throws an exception in the debugger?

I remember it used to do this before.

Now it's only a silent print into the output window informing that an exception is thrown.

I know when it can't find the code, it can do this but when I investigate it, the problem code is mine so it should bring me into the offending line immediately at runtime.

Am I missing something?

Upvotes: 1

Views: 1151

Answers (3)

Bradley Uffner
Bradley Uffner

Reputation: 16991

This can happen when developing on a 64 bit OS when the exception occurs in some event, usually in a form's loading event for example.

As others have mentioned, setting exceptions to "Thrown" in the Exceptions dialog is a quick work around, although this will make Visual Studio stop at EVERY exception, even ones you are properly handing in a Try / Catch block.

Upvotes: 1

Eric Lippert
Eric Lippert

Reputation: 660088

By default that behaviour only happens if the exception is unhandled. You might have an exception handler somewhere that is quietly handling the exception. Note that certain kinds of projects -- like WinForms, for example -- might insert global exception handlers for you, and possibly those are handling the exception.

In the Debug - Exceptions dialog you can say to break in the debugger when the exception is thrown, regardless of whether it is handled or not.

Upvotes: 4

aaaa bbbb
aaaa bbbb

Reputation: 3043

Look at Debug->Exceptions... dialog. You probably have your exception turned off.

Upvotes: 2

Related Questions