Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The application is in break mode - Unable to determine cause

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?

enter image description here

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:

enter image description here

like image 412
tmighty Avatar asked Sep 07 '17 18:09

tmighty


People also ask

How do I turn off break mode?

To exit from break mode, choose Reset from the Run menu. Note that the caption in the titlebar of the VBA IDE indicates which mode is currently active. In particular, the caption contains the word “[running]” when in run mode and “[break]” when in break mode.

What is break mode in Visual Basic?

You enter break mode when you suspend execution of code. This error has the following causes and solutions: You tried to run code from the Macro dialog box. However, Visual Basic was already running code, although the code was suspended in break mode.

How do I allow exceptions in Visual Studio?

When the debugger breaks, it shows you where the exception was thrown. You can also add or delete exceptions. With a solution open in Visual Studio, use Debug > Windows > Exception Settings to open the Exception Settings window. Provide handlers that respond to the most important exceptions.


Video Answer


7 Answers

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"

like image 191
Alternatex Avatar answered Oct 03 '22 00:10

Alternatex


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

like image 36
Alan Warden Avatar answered Oct 02 '22 23:10

Alan Warden


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.

like image 37
tmighty Avatar answered Oct 02 '22 23:10

tmighty


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.

enter image description here

Check document about pseudovariables.

like image 37
Paweł Łukasik Avatar answered Oct 03 '22 01:10

Paweł Łukasik


Go to exception settings and uncheck "Magaged Debugging Assistants" enter image description here

like image 28
user3578181 Avatar answered Oct 03 '22 01:10

user3578181


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

like image 35
impactro Avatar answered Oct 02 '22 23:10

impactro


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.

like image 31
Goodies Avatar answered Oct 03 '22 00:10

Goodies