Blazor 2.51.0 bug

Hello!
The app that was running fine on 2.50.14 bugs now with 2.51.0

radzen: Generating code ...
radzen: Code generation done in 1000ms.
dotnet: watch :
dotnet: Started

dotnet: CSC : warning CS8034: Impossible de charger l'assembly Analyseur C:\Users\RIJA.nuget\packages\microsoft.aspnetcore.components.analyzers\3.1.2\analyzers\dotnet\cs\Microsoft.AspNetCore.Components.Analyzers.dll : Assembly with same name is already loaded [D:\server.csproj]

dotnet: CSC : warning CS8034: Impossible de charger l'assembly Analyseur C:\Users\RIJA.nuget\packages\microsoft.aspnetcore.components.analyzers\3.1.2\analyzers\dotnet\cs\Microsoft.AspNetCore.Components.Analyzers.dll : Assembly with same name is already loaded [D:\server.csproj]

dotnet: Unhandled exception.
dotnet: System.AggregateException: Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: .SecurityService Lifetime: Scoped ImplementationType: .SecurityService': Unable to resolve service for type '.GlobalsService' while attempting to activate '.SecurityService'.)
---> System.InvalidOperationException: Error while validating the service descriptor 'ServiceType: .SecurityService Lifetime: Scoped ImplementationType: .SecurityService': Unable to resolve service for type '.GlobalsService' while attempting to activate '.SecurityService'.
---> System.InvalidOperationException: Unable to resolve service for type '.GlobalsService' while attempting to activate 'Antehiroka.SecurityService'.
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type serviceType, Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(ServiceDescriptor serviceDescriptor, CallSiteChain callSiteChain)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.ValidateService(ServiceDescriptor descriptor)
--- End of inner exception stack trace ---
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.ValidateService(ServiceDescriptor descriptor)
at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(IEnumerable1 serviceDescriptors, ServiceProviderOptions options) --- End of inner exception stack trace --- at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(IEnumerable1 serviceDescriptors, 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 Antehiroka.Program.Main(String[] args) in D:-------------------\server\Program.cs:line 18

dotnet: watch : Exited with error code -532462766

dotnet: watch : Waiting for a file to change before restarting dotnet...

Never seen such error before. If you have Radzen license you can send us an application where we can reproduce it at info@radzen.com.

I am testing community edition with one app so no license. I downgraded and works fine now

I too upgraded to the latest version of the Radzen client this morning and I am also getting an error to do with the Security Service and Lifetime: Scoped ImplementationType.

Easy repro is to make a brand new Blazor app with a default / sample db. Add the security to it and it will not work:

System.AggregateException: Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: Tingz.SecurityService Lifetime: Scoped ImplementationType: Tingz.SecurityService': Unable to resolve service for type 'Tingz.GlobalsService' while attempting to activate 'Tingz.SecurityService'.)
---> System.InvalidOperationException: Error while validating the service descriptor 'ServiceType: Tingz.SecurityService Lifetime: Scoped ImplementationType: Tingz.SecurityService': Unable to resolve service for type 'Tingz.GlobalsService' while attempting to activate 'Tingz.SecurityService'.
---> System.InvalidOperationException: Unable to resolve service for type 'Tingz.GlobalsService' while attempting to activate 'Tingz.SecurityService'.
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type serviceType, Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(ServiceDescriptor serviceDescriptor, CallSiteChain callSiteChain)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.ValidateService(ServiceDescriptor descriptor)
--- End of inner exception stack trace ---
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.ValidateService(ServiceDescriptor descriptor)
at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(IEnumerable1 serviceDescriptors, ServiceProviderOptions options) --- End of inner exception stack trace --- at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(IEnumerable1 serviceDescriptors, 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 Tingz.Program.Main(String[] args) in C:\Dev\Razden\Tingz\server\Program.cs:line 18

It appears that if I add

services.AddScoped();

To the ConfigureServices method prior to any of the other AddScoped calls I can get the application to run.

I could not find any existence of adding the GlobalsService to the source code prior to me adding this

I've managed to reproduce the problem. Fix will be published immediately.