JohnCampionJr / Finbuckle.MultiTenant.MongoFramework

MongoFramework store and per tenant data isolation for Finbucle.MultiTenant
MIT License
4 stars 1 forks source link

Cannot consume scoped service 'Finbuckle.MultiTenant.IMultiTenantStore`1[Finbuckle.MultiTenant.MongoTenantInfo]' from singleton 'Microsoft.Extensions.Hosting.IHostedService'. #27

Closed ruslankiskinov closed 1 month ago

ruslankiskinov commented 3 months ago

I cannot start any of your examples because of the following error:

Cannot consume scoped service 'Finbuckle.MultiTenant.IMultiTenantStore`1[Finbuckle.MultiTenant.MongoTenantInfo]' from singleton 'Microsoft.Extensions.Hosting.IHostedService'.

the problem is connected to this row from the Program.cs: //NOTE: this service will be called by the runtime when application is actually started services.AddSingleton<IHostedService, ApplicationStartedService>();

JohnCampionJr commented 1 month ago

Thank you for reporting this; will fix it ASAP