-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Description
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