I\'m maintaining a number of console applications at work and one thing I\'ve been noticing in a number of them is that they call Environment.Exit(0).
A sample progr
I'm currently using Environment.Exit()
in a console app where I don't want to throw ugly exception text back to the console. Instead I just notice the condition, write a user friendly message to the screen about what happened and then call Environment.Exit()
.
Otherwise, you shouldn't need to call it from Main()
in a basic console application.