The application is in break mode - Unable to determine cause

岁酱吖の 提交于 2019-12-02 22:18:30

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

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"

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.

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.

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.

Go to exception settings and uncheck "Magaged Debugging Assistants"

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!