user4951
user4951

Reputation: 33138

My program in vb.net often end abruptly. How to find end command?

I think there is an end command somewhere that I miss and got called.

However, how to find it.

If I search for end then there are so many end. End sub, end function.

I just want the program to break just before abruptly end.

Is this because of some out of memory or what?

The program run in debug mode. Suddenly it ends. So it runs 100 threads and then the vb 2012 is still running but the program have stopped. As if someone press the stop button or some end statement reached.

Upvotes: 0

Views: 218

Answers (2)

djv
djv

Reputation: 15782

If you want to find End and ignore End Sub etc. you can search using regular expressions (Ctrl+F Alt+E)

End\r?$

Finds End at the end of a line. Interestingly, it's exactly the example in the MSDN regex page

Upvotes: 1

Josh
Josh

Reputation: 10624

Depending on your technology stack, try overriding the OnExit method:

protected override void OnExit(ExitEventArgs e) {
            base.OnExit(e);
        }

Set a break point on the base.onExit(e); line and then look in the call stack. Or if you aren't in the debugger, write to a message box the previously called method.

Upvotes: 1

Related Questions