VS 17 violates all exceptions

Visual Studio 2017 (suddenly) destroys all exceptions. This means that if I deactivate them in the exception settings (by pressing CTRL + ALT + E during debugging), the debugger still breaks. I do not know if this is just a VS error that I cannot change, and therefore I have to live with it, or is there a simple solution for this.

This is the exception settings window: the exception settings

and this VS exception breaks down into: the exception

By the way, I also tried this lovely minus (nothing happens if I click on it) or added an impossible condition (VS was still breaking the exception).

I also tested the other exceptions (just throwing them away) that I had previously deactivated, and they were also thrown, and I tested the same problem in other projects, where it also appeared: the issue in other projects

In fact, I even put all the stuff in a try catch statement, but VS still breaks:

InitializeComponent (); try { var t = new Thread (() => { while (!IsHandleCreated) {} //It breaks here (similiar to the screenshots) while (true) Invoke (new Action (() => Size = new Size ())); }); while (true) { t.Start (); Thread.Sleep (100); t.Abort (); } } catch (ThreadAbortException) { } 

It does not appear in other development environments (for example, Rider) on my PC and does not appear on other PCs in VS. This did not always happen on my PC, it only started recently and only in debug mode. And if I continue execution (using F5), it just continues normally.

EDIT When I put a try-catch inside the stream, it behaved a little differently (sorry to post pictures here, but I think that in this case they are more expressive): new exception location

Can anyone explain this behavior?

EDIT It seems normal for ThreadAbortExceptions to interrupt again at the end of the catch statement. However, VS should not violate this exception anyway.

+16
debugging c # visual-studio winforms visual-studio-2017
source share
4 answers

I had a similar problem.

I fixed this by unchecking "Break when exceptions intersect with AppDomain or managed / native borders" in Tools> Options> Debugging> General

+2
source share

I cannot confirm whether this happens with other types of projects, but it happens to me sequentially (Visual Studio Tools for Python) VSTP.

Although less than satisfactory, it can at least silence exceptions and let you continue to work in the world until a better solution appears. In my case, it was almost impossible to debug my code, since StopIteration is interrupted at each iteration.

Choose Debug> Windows> Exceptions, or press Ctrl-Alt-E . At

Exception Settings

Right-click anywhere in the window and choose Show Columns> Advanced Actions. The "More Actions" column will appear if it is not already installed.

Right-click on the specific exception that you want to disable, or check the top-level checkbox to select a whole category of exceptions, i.e. Python exceptions. Click Continue when Not Processed in Custom Code.

Repeat for each additional exception or exception category.

+1
source share

I know that this is a bit late, but a ThreadAbortException is different from all other exceptions and requires some special handling, otherwise it will automatically be thrown at the end of all catch blocks, unless you actually handle it as intended to be processed.

0
source share

I fixed this by unchecking Enable Just My Code in Tools> Options> Debugging> General

0
source share

All Articles