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

[Feature Request] Add support Keyed Service for IServiceCollection #3088

Closed
wangkewei111 opened this issue Feb 26, 2024 · 2 comments
Closed

Comments

@wangkewei111
Copy link

Description

Microsoft.Extension.DependencyInjection has new feature: Keyed Service from 8.0.0.
But it is not supported in IServiceProviderExtensions.RegisterTypesWithPrismContainer .
Then it throw exception :" Your service provider may not support keyed services "
I suggest add some code if "service.IsKeyedService".

Steps to Reproduce

containerRegistry.RegisterServices(collection => collection.AddKeyedSingleton())

Platform with bug

WPF

Affected platforms

Windows

Did you find any workaround?

No response

Relevant log output

No response

@dansiegel dansiegel changed the title [BUG] Not support Keyed Service for .net 8 [Feature Request] Not support Keyed Service for .net 8 Feb 26, 2024
@dansiegel dansiegel changed the title [Feature Request] Not support Keyed Service for .net 8 [Feature Request] Add support Keyed Service for IServiceCollection Feb 26, 2024
@berhir
Copy link
Contributor

berhir commented Mar 7, 2024

I ran into the same issue today. We updated the package Microsoft.Extensions.Http.Resilience from v8.1.0 to v8.2.0 and suddenly the application crashed at startup with 'This service descriptor is keyed. Your service provider may not support keyed services.'

@dansiegel
Copy link
Member

If you are a Commercial Plus user this is now available starting with Prism.Container.DryIoc 9.0.92 or later.
Prism.Container.Microsoft already supports this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants