开发者

How to prevent Visual Studio from reporting an caught exception?

开发者 https://www.devze.com 2023-03-23 02:56 出处:网络
In this piece of code (runs in a unit test under debugging) try { var process = Process.GetProcessById(ProcessID);

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

精彩评论

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

关注公众号