Exiting the process with the help of Enviroment.FastFail method
Posted on 8/6/2010 7:16:14 AM
in #Dot Net Framework
Have you ever had some point in code where you want to exit the application immediately? Normally for this purpose you would use the Application.Exit method. /SPAN>But Microsoft has provided a better method for this purpose which not only just exits the application but also adds a message to the Windows Application event log./o:p>/P>
The Enviroment.FastFail method takes a string as a parameter writes that value to the Windows Application Event log, creates a dump of the application and exits the process. The string passed is also included in the error reporting to Microsoft. /o:p>/P>
FastFail method should be used instead of the Application.Exit method in case the application is damaged // resource Lost etc. beyond damage and execution of the applications try//finally blocks and finalizer can corrupt the program resources. /o:p>/P>
Vikram/o:p>/P>
|