try
{
Application.Run(new Form1());
}
catch (Exception e)
{
//report exception to server
Through visual studio, the above catch block is actually invoked. (I'm using it for error reporting back to my site, to fix problems and such).
But when I run the standalone exe, the exception is thrown into .NET's exception handling mechanism, and thus is never caught by my try catch block. It mentions JIT (just in time debugging), but I don't know if it has to do with it.
Is this the right way I should be doing this? It makes sense and works through Visual Studio, but not as standalone (which I need).
I hate Slack, but Teams is much worse - maybe they've already optimized it, but it was a huge slog the last time I've checked about half a year ago. I miss my Skype.
Question
zackiv31
try { Application.Run(new Form1()); } catch (Exception e) { //report exception to serverThrough visual studio, the above catch block is actually invoked. (I'm using it for error reporting back to my site, to fix problems and such).
But when I run the standalone exe, the exception is thrown into .NET's exception handling mechanism, and thus is never caught by my try catch block. It mentions JIT (just in time debugging), but I don't know if it has to do with it.
Is this the right way I should be doing this? It makes sense and works through Visual Studio, but not as standalone (which I need).
Link to comment
https://www.neowin.net/forum/topic/619252-c-catch-application-exception/Share on other sites
7 answers to this question
Recommended Posts