问题
I'm experiencing that the IDE breaks sometimes when my application terminates.
When this occurs, the call stack is empty, and the thread list shows some threads which don't reveal any information to me.
When I choose "Debugger"-"Step into", the IDE quits / terminally seemingly normally, so I don't see how I could further investigate what causes the breaking.
Clicking "Check for running Tasks" doesn't display any tasks. Clicking "Continue executing" quits debugging seemingly normally. Clicking "Show diagnostic tools" shows the event "Stop at Execution: Stopped at Execution", which doesn't tell me any more.
A screenshot is attached.
How can I investigate what's causing this break?
Edit: I've tried what one forum member suggested, but that wouldn't result in anything that would help me, I think. This is a screenshot:
回答1:
In one of my web applications I had the same issue, to find out what was wrong,after searching for similar issues, most suggested changing my debugging options. So in the debugging options, under general, I marked the second option "Break all processes when one process breaks" and nearly at the bottom, "Enable native Edit and Continue"; "Apply changes and Continue".
With this, my app finally stopped where I had the issue (Illegal characters in a string which ajax did not like) and was able to evaluate the values and find out what was wrong, edit the code on the go till it worked. Here's a screenshot of my debugger options. Hope you catch your bug:)
Debugger options
回答2:
You may not be able to see the code where the exception happens if it's a part of a library or something else not written by you. The following might help:
Debug > Options > General > Uncheck "Enable Just My Code"
回答3:
When you are in the debugger you can navigate to watch window and use pseudovariables to display some information about the root cause. One particularly useful is $exception
.
Check document about pseudovariables.
回答4:
I didn't find any way to actually debug the problem. I solved the problem the bruteforce way:
I removed all assemblies and COM objects one by one until the error was gone.
In my case, I had a public control with a WithEvents in a module. It seems that VB.NET didn't like that at all. From now on, I will put the control and its withevent in a form.
The main problem however remains: Visual Studio doesn't offer any help to isolate the problem easily.
回答5:
This can also occur when a single threaded Winforms application takes more than 60 seconds to complete an action in the main thread.
I solved it in the dirty way, by calling Application.DoEvents() on regular intervals from the main thread, during too long processing. Exceptions that occur between Application.DoEvents calls are handled properly in the IDE.
回答6:
Go to exception settings and uncheck "Magaged Debugging Assistants"
回答7:
This can occur because some method or constructor is inaccessible (private or internal), put the as public.
The XAML need call the methods to start application
回答8:
This is only a warning message when you run program in debug mode. If you change to the "Release" mode, you will not see this message again.
来源:https://stackoverflow.com/questions/46102963/the-application-is-in-break-mode-unable-to-determine-cause