C# Desktop Application "Encounters an error and has to exit" on first run of the day

Posted by Sreedevi J on Stack Overflow See other posts from Stack Overflow or by Sreedevi J
Published on 2010-04-13T06:33:37Z Indexed on 2010/04/13 6:53 UTC
Read the original article Hit count: 322

Hello,

It seems I tend to attract strange issues. This time, I have written a C# application, and handled most of the exceptions I can find. The problem is, when I run the installed/bundled version on any PC for the first time in a day (after the PC has been shut down and started after a while) it comes across some error and has to shutdown the application (even though the try-catch block surrounding the Main() does not fire). The application does not throw the same error on subsequent runs. I added an

#if(!DEBUG)
...
#else
...
#endif

surrounding the Main() code. Can anyone help me?

Thanks!

© Stack Overflow or respective owner

Related posts about c#

Related posts about desktop-application