Hello everyone,
For the default approach for a console application or Windows service written in C#, if there is an uncaught exception, the console application or the Windows service will terminate? Right?
thanks in advance,
George
This is a discussion on default exception handling within the C# Programming forums, part of the General Programming Boards category; Hello everyone, For the default approach for a console application or Windows service written in C#, if there is an ...
Hello everyone,
For the default approach for a console application or Windows service written in C#, if there is an uncaught exception, the console application or the Windows service will terminate? Right?
thanks in advance,
George
Does for me...
It's not a that hard scenario to test
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
Anything that the catch method could not handle will generally go unhandled unless you specify some conditionals like an if -- else or switch case within the catch method member. This is where you can set-up a safety net that will take all un-handled exceptions and bounce the application back to its feet or you can make a general handling rule that could output a message like "unknown exception occurred."Code:Try() { } Catch() { } Finally() { }
If nothing is explicitly designed within the catch definition to handle a given exception then the application will step into the 'finally()' member for last minute instructions before terminating the application in question. This is where you will explicitly call methods to save work in progress and dispose of external service providers like browsers and notepads that your system called up during runtime.