Skip to content

Injected or scoped ServiceProvider does not support Keyed services #89447

Closed
@CarnaViire

Description

@CarnaViire

Originally posted by @CarnaViire in #89446 (comment)

Scoped ServiceProvider, acquired from a DI scope created by IServiceScopeFactory, [UPD: or any injected IServiceProvider instance] does not implement the IKeyedServiceProvider:

internal sealed class ServiceProviderEngineScope : IServiceScope, IServiceProvider, IAsyncDisposable, IServiceScopeFactory

Because of that, it is impossible to use Keyed services within HttpClientFactory now, see #89446

cc @benjaminpetit @halter73 @steveharter

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions