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

Support Keyed services #86

Open
ElanHasson opened this issue Feb 22, 2024 · 1 comment · May be fixed by #89
Open

Support Keyed services #86

ElanHasson opened this issue Feb 22, 2024 · 1 comment · May be fixed by #89

Comments

@ElanHasson
Copy link

Using .NET 8 and registered keyed services. Also using Lamar, Wolverine, Marten.

System.InvalidOperationException
  HResult=0x80131509
  Message=This service descriptor is keyed. Your service provider may not support keyed services.
  Source=Microsoft.Extensions.DependencyInjection.Abstractions
  StackTrace:
   at Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ThrowKeyedDescriptor()
   at Microsoft.Extensions.DependencyInjection.ServiceDescriptor.get_ImplementationType()
   at Oakton.Resources.ResourceHostExtensions.<>c.<AddResourceSetupOnStartup>b__0_0(ServiceDescriptor x)
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at Oakton.Resources.ResourceHostExtensions.AddResourceSetupOnStartup(IServiceCollection services, StartupAction action)
   at Program.<<Main>$>d__0.MoveNext() 
@ElanHasson
Copy link
Author

ElanHasson commented May 9, 2024

I now know this was dotnet/runtime#95789

x.ImplementationType == typeof(ResourceSetupHostService)))

This is still an issue in Oakton. It's been fixed in Marten, and there is an open PR, JasperFx/lamar#396 for Lamar in JasperFx/lamar#395.

I'll setup a PR to fix this later today/tomorrow.

@ElanHasson ElanHasson linked a pull request May 10, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant