3

Within visual studio I get an dialog saying something like

"An exception of type XXX occurred in YYY.dll but was not handled in user code"

and pausing my code. Is there a way in VS2013 of suppressing this just for this one exception type (this is for a custom exception)?

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
Nick Tucker
  • 323
  • 7
  • 14
  • 1
    Can I ask why you don't just handle the exception in your code? – Sayse Jun 29 '15 at 08:08
  • The alternative is that the default unhandled exception handling takes over and tears down the process. Is that the behaviour you want? – Damien_The_Unbeliever Jun 29 '15 at 08:09
  • The exception is handled by a third party library (quick fix) so I don't want to handle the exception. Just want to stop this from being picked up when debugging in VS. Is there an option to disable this action? – Nick Tucker Jun 29 '15 at 08:44
  • @nick updated my answer to answer on that. The message does indicate it wasn't handled though. – Patrick Hofman Jun 29 '15 at 09:23

1 Answers1

4

Yes, handle the exception.

Either:

  • fix the issue (like in the case of an ArgumentNullException or IndexOutOfRangeException);
  • or if it is something you could expect: use a try...catch block (like internet being down causing an exception).

If you want to disable messages on handled exceptions, you can set when if Visual Studio breaks on a specific exception in the Debug > Exceptions dialog. Then uncheck Thrown for your specific exception.

Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325
  • "was not handled **in user code**". Unchecking *Thrown* for this specific exception will not work if "Just My Code" is enabled and "User-handled" is checked for this exception. – tsul Mar 04 '16 at 11:56