C# Desktop Application "Encounters an error and has to exit" on first run of the day
- by Sreedevi J
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!