rspec/rules/S1147/csharp/rule.adoc

34 lines
711 B
Plaintext
Raw Normal View History

== Why is this an issue?
2021-01-27 13:42:22 +01:00
Calling ``++Environment.Exit(exitCode)++`` or ``++Application.Exit()++`` terminates the process and returns an exit code to the operating system..
2021-02-02 15:02:10 +01:00
2020-06-30 12:47:33 +02:00
Each of these methods should be used with extreme care, and only when the intent is to stop the whole application.
=== Noncompliant code example
2020-06-30 12:47:33 +02:00
2022-02-04 17:28:24 +01:00
[source,csharp]
2020-06-30 12:47:33 +02:00
----
Environment.Exit(0);
Application.Exit();
----
=== Exceptions
2020-06-30 12:47:33 +02:00
2021-01-27 13:42:22 +01:00
These methods are ignored inside ``++Main++``.
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]