Skip to content

Commit 51ed31c

Browse files
OlegKarasikRon Petrusha
authored andcommitted
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.
1 parent 4ecacb7 commit 51ed31c

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

xml/System/Environment.xml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -506,15 +506,15 @@ goto :EOF
506506
<format type="text/markdown"><![CDATA[
507507
508508
## Remarks
509-
This method terminates a process without running any active `try`/`finally` blocks or finalizers.
509+
This method terminates a process without running any active `try`/`finally` blocks or finalizers.
510510
511-
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. The `message` string is also included in error reporting to Microsoft.
511+
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. The `message` string is also included in error reporting to Microsoft.
512512
513-
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.
513+
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.
514514
515515
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).
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).
518518
519519
## Examples
520520
The following example writes a log entry to the Windows Application event log and terminates the current process.
@@ -574,13 +574,15 @@ goto :EOF
574574
## Remarks
575575
This method terminates the process without running any active `try`/`finally` blocks or finalizers.
576576
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.
578578
579579
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.
580580
581581
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.
582582
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).
584586
585587
]]></format>
586588
</remarks>
@@ -2358,4 +2360,4 @@ The following example creates environment variables for the <xref:System.Environ
23582360
</Docs>
23592361
</Member>
23602362
</Members>
2361-
</Type>
2363+
</Type>

0 commit comments

Comments
 (0)