I know about Application.Exit() but what if I'm not in a windows forms application but in a simple class library, how do I signal for the application to exit?
+2
A:
P/Invoke ExitProcess, perhaps. Or if you're really in a hurry, TerminateProcess.
Chris Charabaruk
2008-10-07 00:14:48
Is there no .NET BCL way to do this?!!
George Mauer
2008-10-07 00:19:38
Other than returning from the entry point, no.
Chris Charabaruk
2008-10-07 00:25:52
+4
A:
Environment.Exit() -- but why would you ever want to do this from a method in a class library?
tvanfosson
2008-10-07 00:36:16
Forgot about this. It's probably better than my P/Invoke suggestions.
Chris Charabaruk
2008-10-07 00:56:06
Mind you - this requires extra security privileges (really wish it didn't...) - specifically, executing unmanaged code.
romkyns
2010-01-08 10:26:14