-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
🏁 Release: .NET 6Issues and PRs for the .NET 6 releaseIssues and PRs for the .NET 6 releasebreaking-changeIndicates a .NET Core breaking changeIndicates a .NET Core breaking changesource incompatibleSource code may encounter a breaking change in behavior when targeting the new version.Source code may encounter a breaking change in behavior when targeting the new version.
Description
Description
Resolving Services after ServiceProvider is Disposed should throw with ObjectDisposedException
.
Version
.NET 6 RC 1
Previous behavior
Prior to the new change, if the application when through the rare case of resolving a service after service provider is disposed, it would lead to deadlock.
New behavior
Rather than deadlock, it will throw ObjectDisposedException
.
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
To unblock the deadlock scenario.
Recommended action
N/A
Feature area
C#, Core .NET libraries, Extensions
Affected APIs
IServiceProvider
GetService
or GetRequiredService
with Dispose
usages in combination.
Metadata
Metadata
Assignees
Labels
🏁 Release: .NET 6Issues and PRs for the .NET 6 releaseIssues and PRs for the .NET 6 releasebreaking-changeIndicates a .NET Core breaking changeIndicates a .NET Core breaking changesource incompatibleSource code may encounter a breaking change in behavior when targeting the new version.Source code may encounter a breaking change in behavior when targeting the new version.