Reputation: 41
In C#, what would cause Environment.Exit(1) to hang? I'm calling my program from the command line, and it ends up with a blinking cursor on a blank line. Typing doesn't do anything.
Upvotes: 2
Views: 1377
Reputation: 16162
The Environment.Exit doesn't hang the application, on the contrary, it terminates it instantly:
Terminates this process and gives the underlying operating system the specified exit code.
There is something else causing your Console application to hang, but we can't guess what is the issue without you adding some code.
Upvotes: 1