Multi tenant issue in latest release

I am still investigating but it seems that something is broken in the latest release. I get an odd message in VS and the app fails to start.

Here is the exception:

  Message=Some services are not able to be constructed
   at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(IEnumerable`1 serviceDescriptors, IServiceProviderEngine engine, ServiceProviderOptions options)
   at Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(IServiceCollection services, ServiceProviderOptions options)
   at Microsoft.Extensions.DependencyInjection.DefaultServiceProviderFactory.CreateServiceProvider(IServiceCollection containerBuilder)
   at Microsoft.Extensions.Hosting.Internal.ServiceFactoryAdapter`1.CreateServiceProvider(Object containerBuilder)
   at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at STracker.Program.Main(String[] args) in C:\Dev\stracker\server\Program.cs:line 18

  This exception was originally thrown at this call stack:
    [External Code]

Inner Exception 1:
InvalidOperationException: Error while validating the service descriptor 'ServiceType: Microsoft.AspNetCore.Identity.ISecurityStampValidator Lifetime: Scoped ImplementationType: Microsoft.AspNetCore.Identity.SecurityStampValidator`1[STracker.Models.ApplicationUser]': Unable to resolve service for type 'STracker.GlobalsService' while attempting to activate 'STracker.MultiTenancyUserStore'.

Inner Exception 2:
InvalidOperationException: Unable to resolve service for type 'STracker.GlobalsService' while attempting to activate 'STracker.MultiTenancyUserStore'.

And the message in vs:

OK. Found the issue. The startup.cs references the Globals service which is a client side service. By adding the same service to the server, this error goes away. Is this a bug because I cannot find any relevant changes in my code.

1 Like

Hi @simon,

Thanks for the report! This should not be referenced/generated in WASM applications - it will be fixed immediately!

UPDATE: You can get the latest build for Windows from here.

1 Like