-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
Description
The [HandleProcessCorruptedStateExceptions]
attribute is marked as [Obsolete]
, beginning in .NET 6 RC1.
In .NET Framework, this attribute allowed managed code to opt into being able to handle exceptions related to corrupt process state. Even though this attribute exists in .NET Core, since the recovery from corrupted process state exceptions is not supported, this attribute is ignored. The CLR doesn't deliver corrupted process state exceptions to the managed code.
To reflect that this attribute is ignored, it has now been marked as [Obsolete]
and its usage will result in a build warning. If a project's build is configured to treat warnings as errors, this will be a source-breaking change in .NET 6.
Version
.NET 6 RC1
Previous behavior
In .NET Framework, the [HandleProcessCorruptedStateExceptions]
attribute could be applied, allowing the code to handle such exceptions.
In .NET Core and .NET 5, the attribute could be applied, but it was ignored by the runtime.
New behavior
Usage of this attribute will result in a build warning, or a build error if warnings are treated as errors.
Type of breaking change
- Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load/execute or different run-time behavior.
- Source incompatible: Source code may encounter a breaking change in behavior when targeting the new runtime/component/SDK, such as compile errors or different run-time behavior.
Reason for change
The attribute is ignored by the runtime and therefore should no longer be used.
Recommended action
Remove the [HandleProcessCorruptedStateExceptions]
attribute from code. If that code was specifically handling corrupted process state exceptions, such code can also be removed as those exceptions can no longer be handled.
Feature area
Core .NET libraries