C#

C#

Made by DeepSource

Abrupt application exit CS-W1005

Bug risk
Major

Using Environment.Exit(0) terminates the application abruptly in a potentially unsafe manner. An application should always try to quit gracefully irrespective of whether it encounters an error or not. If your application has to terminate, ensure that it implements the required cleanup/dispose methods to at least safely dispose off the resources that it has acquired/locked to the extent possible and then exit cleanly/gracefully.

Reference