Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Breaking change]: HandleProcessCorruptedStateExceptionsAttribute is marked as Obsolete #25450

Closed
1 of 2 tasks
jeffhandley opened this issue Aug 3, 2021 · 1 comment
Closed
1 of 2 tasks
Assignees
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.

Comments

@jeffhandley
Copy link
Member

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

Affected APIs

@jeffhandley jeffhandley added doc-idea Indicates issues that are suggestions for new topics [org][type][category] breaking-change Indicates a .NET Core breaking change Pri1 High priority, do before Pri2 and Pri3 labels Aug 3, 2021
@dotnet-bot dotnet-bot added ⌚ Not Triaged Not triaged 🏁 Release: .NET 6 Issues and PRs for the .NET 6 release labels Aug 3, 2021
@gewarren gewarren added source incompatible Source code may encounter a breaking change in behavior when targeting the new version. and removed ⌚ Not Triaged Not triaged labels Aug 4, 2021
@jeffhandley
Copy link
Member Author

Added this to #23856.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

3 participants