Vb.net Opening a second form exits the application?

Dylan Dingjan 1 Reputation point
2021-02-01T10:28:38.657+00:00

So I’ve been programming a POS System for almost a year now. When I opened the project this morning I was not able to open the main form. I have a start-up screen and when you press a button, which covers the whole screen, you get to the main screen. However when I opened the project this morning when I tapped the big button, the application stopped immediately with no errors.
I have looked into the code and there is no line that ends the application. The code to open the form is just: Form2.Show() and the first lines executed by the form also have no line that ends the application.

I’ve looked around the internet, but because this problem came after no changes in the code itself, for me it is still a mystery as to why my application ends every time.

All help is welcome!

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,911 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Karen Payne MVP 35,461 Reputation points
    2021-02-01T21:49:26.66+00:00

    Hello @Dylan Dingjan

    There are several things to try

    • From Solution Explorer, clean then rebuild, run, did this fix the problem, no continue
    • Under the debug menu, windows, exception setting check "Common Language Runtime Exceptions", rebuild run. If the issue is a non-fatal issue the offending line will be stopped on in the IDE, figure out why (one way is to use a breakpoint prior to the offending line and step through the code examining variables for possible issues)
    • From the start of the program, set a breakpoint and step through code until it raises an exception.

    If none of the above helped, and since no code changed, were there any Windows or other software updates done since last time you ran the application?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.