I have a function in C# code where a NullReferenceException is thrown periodically (expected behavior), but caught. Is there a way I can tell the Visual Studio debugger to n
Assuming the exception does not bubble up to the caller, this can be achieved with DebuggerHiddenAttribute.
From the remarks
the Visual Studio 2005 debugger does not stop in a method marked with this attribute and does not allow a breakpoint to be set in the method.
[DebuggerHidden]
private static void M()
{
try
{
throw new NullReferenceException();
}
catch (Exception)
{
//log or do something useful so as not to swallow.
}
}