Events
17 Mar, 9 pm - 21 Mar, 10 am
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Specifies whether the common language runtime allows managed code to catch access violations and other corrupted state exceptions.
<configuration>
<runtime>
<legacyCorruptedStateExceptionsPolicy>
<legacyCorruptedStateExceptionsPolicy enabled="true|false"/>
The following sections describe attributes, child elements, and parent elements.
Attribute | Description |
---|---|
enabled |
Required attribute. Specifies that the application will catch corrupting state exception failures such as access violations. |
Value | Description |
---|---|
false |
The application will not catch corrupting state exception failures such as access violations. This is the default. |
true |
The application will catch corrupting state exception failures such as access violations. |
None.
Element | Description |
---|---|
configuration |
The root element in every configuration file used by the common language runtime and .NET Framework applications. |
runtime |
Contains information about assembly binding and garbage collection. |
In the .NET Framework version 3.5 and earlier, the common language runtime allowed managed code to catch exceptions that were raised by corrupted process states. An access violation is an example of this type of exception.
Starting with the .NET Framework 4, managed code no longer catches these types of exceptions in catch
blocks. However, you can override this change and maintain the handling of corrupted state exceptions in two ways:
<legacyCorruptedStateExceptionsPolicy>
element's enabled
attribute to true
. This configuration setting is applied processwide and affects all methods.-or-
catch
block.This configuration element is available only in the .NET Framework 4 and later.
The following example shows how to specify that the application should revert to the behavior before the .NET Framework 4, and catch all corrupting state exception failures.
<configuration>
<runtime>
<legacyCorruptedStateExceptionsPolicy enabled="true" />
</runtime>
</configuration>
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Events
17 Mar, 9 pm - 21 Mar, 10 am
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register now