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

AddMartenStore<T> throws System.InvalidOperationException: This service descriptor is keyed. Your service provider may not support keyed services. #2892

Closed
dystopiandev opened this issue Jan 8, 2024 · 0 comments · Fixed by #2905

Comments

@dystopiandev
Copy link
Contributor

When called on a ServiceCollection that contains keyed services, AddMartenStore throws:

Unhandled exception. System.InvalidOperationException: This service descriptor is keyed. Your service provider may not support keyed services.
   at Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ThrowKeyedDescriptor()
   at Microsoft.Extensions.DependencyInjection.ServiceDescriptor.get_ImplementationInstance()
   at Marten.MartenServiceCollectionExtensions.<>c__12`1.<AddMartenStore>b__12_0(ServiceDescriptor x)
   at System.Linq.Enumerable.SelectIListIterator`2.MoveNext()
   at System.Linq.Enumerable.OfTypeIterator[TResult](IEnumerable source)+MoveNext()
   at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found)
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at Marten.MartenServiceCollectionExtensions.AddMartenStore[T](IServiceCollection services, Func`2 configure)
  • Marten: 7.0.0-beta.3
  • .NET SDK: 8.0.100
  • OS/Arch: MacOS/ARM64
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