Wednesday, April 30, 2014

Prevent C# console from closing on exception

I think that the only way you can achieve it is to put some try-catch blocks around your code, each one give back the precise info about the raised exception.


Than in main() you put a nother try-catch block to intercept the top-level raised exception and, i.e. write in the console output.


Note that with this solution the console won't close, but won't work anymore since a restart.




Davide 'n3wt0n' Benvegnù



If you found my answer helpful, please vote it.

If you think that my answer resolve your issue, plase "Mark it as answer".


No comments:

Post a Comment