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
{{ message }}
This repository was archived by the owner on Dec 26, 2025. It is now read-only.
Please be sure to check the readme file before raising an issue.
I am trying to use Blazor storage library in Blazor Hosted WebAssembly.
public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
builder.Services.AddAuthorizationCore();
builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddBlazoredLocalStorage();
builder.Services.AddBlazoredSessionStorage();
builder.Services.AddScoped<AppStateInfo,AppStateInfo>();
builder.Services.AddScoped<CustomAuthenticationStateProvider>();
builder.Services.AddScoped<AuthenticationStateProvider>(provider =>
provider.GetRequiredService<CustomAuthenticationStateProvider>());
builder.Services.AddOptions();
var host = builder.Build();
await host.RunAsync();
}
}
Error i get is as follow
Unhandled exception rendering component: Unable to resolve service for type 'Blazored.LocalStorage.LocalStorageService' while attempting to activate 'myCustomApp.Services.CustomAuthenticationStateProvider'.
System.InvalidOperationException: Unable to resolve service for type 'Blazored.LocalStorage.LocalStorageService' while attempting to activate 'myCustomApp.CustomAuthenticationStateProvider'.
My Constructor looks like this and class is in the Blazor Client Project
Please be sure to check the readme file before raising an issue.
I am trying to use Blazor storage library in Blazor Hosted WebAssembly.
Error i get is as follow
Unhandled exception rendering component: Unable to resolve service for type 'Blazored.LocalStorage.LocalStorageService' while attempting to activate 'myCustomApp.Services.CustomAuthenticationStateProvider'.
System.InvalidOperationException: Unable to resolve service for type 'Blazored.LocalStorage.LocalStorageService' while attempting to activate 'myCustomApp.CustomAuthenticationStateProvider'.
My Constructor looks like this and class is in the Blazor Client Project