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:
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.
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.
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.
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"
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
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.
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.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With