0

I have a project (from a SVN repository), which ran yesterday when I start a new debug instance. It'd show me a form and let me do some stuff on it. Today, I tried to run a new debug instance again (the old one is closed/stopped). It's not showing me the form, although it seems like everything started and there were no errors shown.

I even tried to revert the SVN repository to the last version (the version I started with, which worked). Still, it's not showing me the form, so I was thinking perhaps I switched a setting or something?

I'm not too familiar with Visual Studio 2008 so I'd tought I ask here first.

Joetjah
  • 6,292
  • 8
  • 55
  • 90
  • If you are running Winforms there is an issue with the Form_Load EventHandler that if there is an error, it won't be thrown. I would put a breakpoint on the start of the Form_Load method and step through it making sure there are not any problems. See this [SO Question](http://stackoverflow.com/questions/1583351/silent-failures-in-c-seemingly-unhandled-exceptions-that-does-not-crash-the-pr) – Mark Hall Feb 07 '13 at 08:28
  • Hmm, nice tip, I didn't know that. Even so, my Windows is running on 32 bit. But I at least know where to look now. – Joetjah Feb 07 '13 at 08:38
  • You may want to put your breakpoint sooner like in the Form's Constructor in case you have an error in your IntializeComponent Method. – Mark Hall Feb 07 '13 at 08:43
  • Hmm, it seems to be that the problem is way deeper in initialising the application. When I initialize the application and the form, somewhere loading some classes a fail occurs. I'm going to debug it to see what I can find (in these cases you hate the too-many-code-debugging)... – Joetjah Feb 07 '13 at 08:46
  • It seems the problem lies deeper, where I try to open a COM-port. I guess if you place the answer (I don't know if it still refers to the form, even though Initialise Components was eventually called in the form) I can accept it. – Joetjah Feb 07 '13 at 08:56

1 Answers1

0

If you are running Winforms there is an issue with the Form_Load EventHandler that if there is an error, it won't be thrown. I would put a breakpoint on the start of the Form_Load method and step through it making sure there are not any problems. See this SO Question.

If that doesn't work I would put your breakpoint in the Forms Constructor and step through your code to make sure that there are no problems with the InitializeComponent Method.

You also mention in your comment that your problem has to to with a Com Port. If you ran your program earlier and it hung or never really exited there still is a chance that an instance of your program is still running, you need to check your TaskManager. It can lock the port and prevent you from being able to open it( I have been there and done that ). I have had to Kill all instances of my program, and if that didn't work reboot the computer and the remote device.

Community
  • 1
  • 1
Mark Hall
  • 53,938
  • 9
  • 94
  • 111
  • 1
    The problem here lied in the database I used. It had some devices saved, but unfortunately my code wasn't safe enough so multiple saved devices on the same COM-port could be opened. When starting the application, it tried to open the same COM-port twice. – Joetjah Feb 08 '13 at 07:54