The application is in a break mode - it is impossible to determine the cause

I experience that the IDE sometimes interrupts when my application terminates.

When this happens, the call stack is empty and the list of threads shows some threads that do not reveal any information to me.

When I select "Debugger" - "Step into", the IDE completes / seems to be fine, so I don’t see how I could continue to investigate what causes the violation.

Clicking "Verify Tasks" does not display any tasks. Clicking the Continue Execution button completes debugging as usual. By clicking "Show diagnostic tools", the event "Stop at run: stopped at run" is displayed, which no longer tells me.

Attached screenshot.

How can I find out what causes this gap?

enter image description here

Edit: I tried what one of the forum participants suggested, but that would not lead to anything that could help me, I think. This is a screenshot:

enter image description here

+8
debugging ide visual-studio-2017
source share
6 answers

I did not find a way to debug the problem. I solved the problem with brute force:

I deleted all the assemblies and COM objects one by one until the error went away.

In my case, I had public control with WithEvents in the module. VB.NET doesn't seem to like this at all. From now on I will put the control and its withevent in the form.

The main problem, however, remains: Visual Studio does not offer any help to isolate the problem easily.

+1
source share

In one of my web applications, I had the same problem to find out what was wrong, after searching for similar problems, most suggested changing the debugging options. Therefore, in the debugging options, under the general one, I noted the second option, “Break all processes when one process breaks” and almost at the bottom, “Turn on your own editing and continue”; "Apply changes and continue."

With this, my application finally stopped where I had a problem (invalid characters in the line that ajax did not like) and was able to evaluate the values ​​and find out what is wrong, edit the code on the go until it works. Here is a screenshot of mine debugger options. I hope you catch your mistake :)

Debugger options

+4
source share

When you are in the debugger, you can go to the viewport and use pseudo-options to display some information about the root cause. It is especially useful to use $exception .

enter image description here

Check out the pseudovariables document.

+2
source share

This can happen because some method or constructor is not available (private or internal), puts it as public.

XAML need to call methods to run the application

0
source share

This can also happen if a single-threaded Winforms application takes more than 60 seconds to complete an action in the main thread.

I solved this in a dirty way by calling Application.DoEvents () at regular intervals from the main thread, with processing taking too long. Exceptions that occur between calls to Application.DoEvents are handled properly in the IDE.

0
source share

You may not be able to see the code in which the exception occurs if it is part of a library or something else you have not written. The following may help:

Debugging> Options> General> Uncheck the box "Include only my code"

0
source share

All Articles