Closed franklupo closed 2 years ago
Hi,
I didn't try it, but I assume it should work.
Best regards,
i have a problem with AddDbContext from scope to transient.
Hi,
InvalidOperationException: Cannot consume scoped service 'Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage.ProtectedLocalStorage' from singleton 'XLocalizer.DB.IDbResourceProvider'.
How to resolve?
It seems your DB is registered as a scoped service, you have to register it as Transient
.
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")),
ServiceLifetime.Transient,
ServiceLifetime.Transient);
Not work
Well, just noticed this error is relevant to Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage.ProtectedLocalStorage
, in this case this library wont help for the time being. I can't promise to develop a solution soon, but you may try to change the lifecycle of the mentioned service.
Grazie
HI, is it possible to use AddXDbLocalizer with Blazor?
bets regards