Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BlazorStorage.Services.LocalStorage': Cannot consume scoped service 'Microsoft.JSInterop.IJSRuntime' from singleton 'BlazorStorage.Interfaces.ILocalStorage' #6

Open
AbbasNarimani opened this issue Feb 4, 2021 · 1 comment

Comments

@AbbasNarimani
Copy link

Hi,
I'm trying to add the persistent state capability of this package in my project, but unfortunately by adding "cfg.UseLocalStorage();" option, I face with the following exception

'ServiceType: BlazorStorage.Interfaces.ILocalStorage Lifetime: Singleton ImplementationType: BlazorStorage.Services.LocalStorage': Cannot consume scoped service 'Microsoft.JSInterop.IJSRuntime' from singleton 'BlazorStorage.Interfaces.ILocalStorage'.) (Error while validating the service descriptor 'ServiceType: BlazorStorage.Interfaces.ISessionStorage Lifetime: Singleton ImplementationType: BlazorStorage.Services.SessionStorage': Cannot consume scoped service 'Microsoft.JSInterop.IJSRuntime' from singleton 'BlazorStorage.Interfaces.ISessionStorage'.)'

here are more information:
net5.0

any help will be appreciated

@BerserkerDotNet
Copy link
Owner

Hi @AbbasNarimani , sorry for a late reply. Do you use server or client application?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants