You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: xml/System/Environment.xml
+10-8Lines changed: 10 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -547,7 +547,7 @@ Invalid argument
547
547
<AssemblyVersion>4.2.0.0</AssemblyVersion>
548
548
</AssemblyInfo>
549
549
<Docs>
550
-
<summary>Immediately terminates a process after writing a messageto the Windows Application event log, and then includes the message and optional exception information in error reporting to Microsoft.</summary>
550
+
<summary>Immediately terminates the process before reporting an error message. For Windows, the error message is written to the Windows Application event log, and the message and optional exception information is included in error reporting to Microsoft. For Unix-like systems, the message, alongside the stack trace, is written to the standard error stream.</summary>
551
551
</Docs>
552
552
</MemberGroup>
553
553
<MemberMemberName="FailFast">
@@ -608,23 +608,23 @@ Invalid argument
608
608
</Parameters>
609
609
<Docs>
610
610
<paramname="message">A message that explains why the process was terminated, or <seelangword="null" /> if no explanation is provided.</param>
611
-
<summary>Immediately terminates a process after writing a messageto the Windows Application event log, and then includes the message in error reporting to Microsoft.</summary>
611
+
<summary>Immediately terminates the process before reporting an error message. For Windows, the error message is written to the Windows Application event log, and the message is included in error reporting to Microsoft. For Unix-like systems, the message, alongside the stack trace, is written to the standard error stream.</summary>
612
612
<remarks>
613
613
<formattype="text/markdown"><.
619
+
620
+
On Unix-like systems, the message is written to the standard error stream, alongside the stack trace information.
619
621
620
622
Use the `Environment.FailFast` method instead of the <xref:System.Environment.Exit%2A> method to terminate your application if the state of your application is damaged beyond repair, and executing your application's `try`/`finally` blocks and finalizers will corrupt program resources.
621
623
622
-
Information is reported to Microsoft by using Windows Error Reporting. For more information, see [Windows Error Reporting: Getting Started](/windows-hardware/drivers/dashboard/).
623
-
624
624
Calling the `Environment.FailFast` method to terminate execution of an application running in the Visual Studio debugger throws an <xref:System.ExecutionEngineException> and automatically triggers the [fatalExecutionEngineError managed debugging assistant (MDA)](/dotnet/framework/debug-trace-profile/fatalexecutionengineerror-mda).
625
625
626
626
## Examples
627
-
The following example writes a log entry to the Windows Application event log and terminates the current process.
627
+
The following example writes a log entry to the Windows Application event log when running under Windows, or writes the error message to the standard error stream when running under a Unix-like system, and terminates the current process.
@@ -693,16 +693,18 @@ Calling the `Environment.FailFast` method to terminate execution of an applicati
693
693
<Docs>
694
694
<paramname="message">A message that explains why the process was terminated, or <seelangword="null" /> if no explanation is provided.</param>
695
695
<paramname="exception">An exception that represents the error that caused the termination. This is typically the exception in a <seelangword="catch" /> block.</param>
696
-
<summary>Immediately terminates a process after writing a messageto the Windows Application event log, and then includes the message and exception information in error reporting to Microsoft.</summary>
696
+
<summary>Immediately terminates the process before reporting an error message. For Windows, the error message is written to the Windows Application event log, and the message and exception information is included in error reporting to Microsoft. For Unix-like systems, the message alongside the stack trace is written to the standard error stream.</summary>
697
697
<remarks>
698
698
<formattype="text/markdown"><. Error reporting to Microsoft includes `message` and `exception` information, which provides details used to classify the error. Although `exception` is not handled because the process is terminated, the contextual information that raised the exception is still obtained.
706
+
707
+
On Unix-like systems, the message is written to the standard error stream, alongside the stack trace information.
706
708
707
709
If `exception` is `null`, or if `exception` is not thrown, this method operates the same as the <xref:System.Environment.FailFast%28System.String%29> method overload.
0 commit comments