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

Access to ImplementationFactory Throws if KeyedService #210

Open
Mike-E-angelo opened this issue Aug 28, 2024 · 0 comments
Open

Access to ImplementationFactory Throws if KeyedService #210

Mike-E-angelo opened this issue Aug 28, 2024 · 0 comments

Comments

@Mike-E-angelo
Copy link

Greetings out there @seesharper I hope this finds you well. 👋

There appears to be an issue when LightInject creates a provider that has keyed services. It's a little tricky because this appears to be a framework issue that is addressed in .NET9 and has a fix on the way with .NET8. However, it is unclear how long it will be before this is released so I am reporting it here to see if it might be possible to address it sooner. 😁

I originally reported this issue here:
dotnet/extensions#5376

(You can follow the steps to reproduce)

The fix there worked, but upon incorporating Redis support in my Aspire application, I ran into it again with the Aspire hosting assembly Aspire.StackExchange.Redis.OutputCaching. As I am getting the sense there will be more assemblies on the way before the .NET8 fix I am reaching out here to see if we can get a hot/quick fix even if it's on a preview build.

The issue appears to happen here:
https://github.com/seesharper/LightInject.Microsoft.DependencyInjection/blob/master/src/LightInject.Microsoft.DependencyInjection/LightInject.Microsoft.DependencyInjection.cs#L146

Access to ImplementationFactory when the service descriptor has a key will result in an exception.

Please let me know if you have any questions around this and I will assist. 👍

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

No branches or pull requests

1 participant