[Breaking change]: HandleProcessCorruptedStateExceptionsAttribute is marked as Obsolete #25450
Closed
1 of 2 tasks
Labels
breaking-change
Indicates a .NET Core breaking change
🏁 Release: .NET 6
Issues and PRs for the .NET 6 release
doc-idea
Indicates issues that are suggestions for new topics [org][type][category]
Pri1
High priority, do before Pri2 and Pri3
source incompatible
Source code may encounter a breaking change in behavior when targeting the new version.
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
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
Affected APIs
The text was updated successfully, but these errors were encountered: