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
Environment.FailFast (added information about System.ExecutionEngineException) (dotnet#2641)
* Added information about System.ExecutionEngineException in FailFast methods "Remarks" section
I think this information can be of use because currently when you hit `Environment.FailFast` statement in the debugger you are confused by unhandled `System.ExecutionEngineException` exception, which is by definition represents a failure in CLR rather than a way to terminate the process without invoking all the `try / catch / finally` blocks.
* Added more information as mentioned in comments
Updated Remarks sections of both FailFast overloads with description proposed by @rpetrusha.
* Removed self-referencing links.
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
@@ -506,15 +506,15 @@ goto :EOF
506
506
<formattype="text/markdown"><.
516
-
517
-
516
+
517
+
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)](https://github.com/dotnet/docs/blob/master/docs/framework/debug-trace-profile/fatalexecutionengineerror-mda.md).
518
518
519
519
## Examples
520
520
The following example writes a log entry to the Windows Application event log and terminates the current process.
@@ -574,13 +574,15 @@ goto :EOF
574
574
## Remarks
575
575
This method terminates the process without running any active `try`/`finally` blocks or finalizers.
576
576
577
-
The <xref:System.Environment.FailFast%2A> method writes the `message` string to the Windows Application event log, creates a dump of your application, and then terminates the current process.
577
+
The `Environment.FailFast` method writes the `message` string to the Windows Application event log, creates a dump of your application, and then terminates the current process.
578
578
579
579
Information is reported to Microsoft by using Windows Error Reporting. For more information, see [Windows Error Reporting: Getting Started](https://msdn.microsoft.com/library/windows/hardware/dn641144.aspx). 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.
580
580
581
581
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.
582
582
583
-
Use the <xref:System.Environment.FailFast%2A> 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.
583
+
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.
584
+
585
+
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)](https://github.com/dotnet/docs/blob/master/docs/framework/debug-trace-profile/fatalexecutionengineerror-mda.md).
584
586
585
587
]]></format>
586
588
</remarks>
@@ -2358,4 +2360,4 @@ The following example creates environment variables for the <xref:System.Environ
0 commit comments