Skip to content

[Breaking change]: SystemEvents.EventsThreadShutdown Obsolete with SYSLIB0059Β #43563

@lonitra

Description

@lonitra

Description

After https://github.com/dotnet/runtime/pull/108489/files SystemEvents.EventsThreadShutdown callbacks will no longer be called before the process exits. It is marked as obsolete with SYSLIB0059

Version

.NET 10 Preview 1

Previous behavior

SystemEvents.EventsThreadShutdown callbacks would be called before the process exits.

New behavior

SystemEvents.EventsThreadShutdown callbacks are no longer called before the process exits.

Type of breaking change

  • Binary incompatible: Existing binaries might encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
  • Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code might require source changes to compile successfully.
  • Behavioral change: Existing binaries might behave differently at run time.

Reason for change

SystemEvents' previous shutdown handling could block the finalizer thread during app shutdown. To avoid blocking finalizer thread, SystemEvents no longer has shutdown handling consequentially meaning that SystemEvents.EventsThreadShutdown is no longer called.

Recommended action

Recommendation is if users had been using this is to hook to AppDomain.ProcessExit instead.

Feature area

Core .NET libraries

Affected APIs

SystemEvents.EventsThreadShutdown


Associated WorkItem - 361485

Metadata

Metadata

Assignees

Labels

🏁 Release: .NET 10Work items for the .NET 10 releaseπŸ“Œ seQUESTeredIdentifies that an issue has been imported into Quest.breaking-changeIndicates a .NET Core breaking changein-prThis issue will be closed (fixed) by an active pull request.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions