You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use this with the official Blazor release, but I get an error when following the example. Especially with this line: services.AddSingleton<LocationService>();
I get the following error when starting it up: AggregateException: Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: AspNetMonsters.Blazor.Geolocation.LocationService Lifetime: Singleton ImplementationType: AspNetMonsters.Blazor.Geolocation.LocationService': Cannot consume scoped service 'Microsoft.JSInterop.IJSRuntime' from singleton 'AspNetMonsters.Blazor.Geolocation.LocationService'.) Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(IEnumerable<ServiceDescriptor> serviceDescriptors, ServiceProviderOptions options)
I tried changing the AddSingleton() to a AddScoped(), but then I got another run-time error.
Let me know if you need some logs or anything else from me.
The text was updated successfully, but these errors were encountered:
Hi,
I am trying to use this with the official Blazor release, but I get an error when following the example. Especially with this line:
services.AddSingleton<LocationService>();
I get the following error when starting it up:
AggregateException: Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: AspNetMonsters.Blazor.Geolocation.LocationService Lifetime: Singleton ImplementationType: AspNetMonsters.Blazor.Geolocation.LocationService': Cannot consume scoped service 'Microsoft.JSInterop.IJSRuntime' from singleton 'AspNetMonsters.Blazor.Geolocation.LocationService'.) Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(IEnumerable<ServiceDescriptor> serviceDescriptors, ServiceProviderOptions options)
I tried changing the AddSingleton() to a AddScoped(), but then I got another run-time error.
Let me know if you need some logs or anything else from me.
The text was updated successfully, but these errors were encountered: