开发者

How to prevent Visual Studio from reporting an caught exception?

In this piece of code (runs in a unit test under debugging)

try
{
    var process = Process.GetProcessById(ProcessID);

    _isRunningCache = WindowHandle != IntPtr.Zero
                 && User32.IsWindow(WindowHandle) && !process.HasExited
                 && process.Responding;
}
catch
{
    return Invalidate();
}

I receive a report for an exception occurred (I do have reporting of u开发者_StackOverflownhandled exceptions enabled), but nevertheless visual studio interrupts the process and reports the exeption in the following manner:

How to prevent Visual Studio from reporting an caught exception?

What can I do to prevent this? (despite disabling reporting of unhandled exceptions)


Go to Debug -> Exceptions and deselect any checkboxes in the 'Thrown' column.

Ensure the 'User-unhandled' is checked for Common Language Runtime Exceptions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜