Rubix314
Rubix314

Reputation: 41

Environment.Exit hangs

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

Answers (1)

Jalal Said
Jalal Said

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

Related Questions