Fix: Services are not able to be constructed Microsoft.AspNetCore.Identity.ISecurityStampValidator

ASP.NET MVC
ASP.NET MVC
15.4 هزار بار بازدید - پارسال - System.AggregateException: 'Some services are not
System.AggregateException: 'Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: Microsoft.AspNetCore.Identity.ISecurityStampValidator Lifetime: Scoped ImplementationType: Microsoft.AspNetCore.Identity.SecurityStampValidator`1[ePizzaHub.Entities.User]': Unable to resolve service for type 'ePizzaHub.Repositories.AppDbContext' while attempting to activate 'Microsoft.AspNetCore.Identity.EntityFrameworkCore.UserStore`9[ePizzaHub.Entities.User,ePizzaHub.Entities.Role,ePizzaHub.Repositories.AppDbContext,System.Int32,Microsoft.AspNetCore.Identity.IdentityUserClaim`1[System.Int32],Microsoft.AspNetCore.Identity.IdentityUserRole`1[System.Int32],Microsoft.AspNetCore.Identity.IdentityUserLogin`1[System.Int32],Microsoft.AspNetCore.Identity.IdentityUserToken`1[System.Int32],Microsoft.AspNetCore.Identity.IdentityRoleClaim`1[System.Int32]]'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AspNetCore.Identity.ITwoFactorSecurityStampValidator Lifetime: Scoped ImplementationType: Microsoft.AspNetCore.Identity.TwoFactorSecurityStampValidator`1[ePizzaHub.Entities.User]': Unable to resolve service for type 'ePizzaHub.Repositories.AppDbContext' while attempting to activate 'Microsoft.AspNetCore.Identity.EntityFrameworkCore.UserStore`9[ePizzaHub.Entities.User,ePizzaHub.Entities.Role,ePizzaHub.Repositories.AppDbContext,System.Int32,Microsoft.AspNetCore.Identity.IdentityUserClaim`1[System.Int32],Microsoft.AspNetCore.Identity.IdentityUserRole`1[System.Int32],Microsoft.AspNetCore.Identity.IdentityUserLogin`1[System.Int32],Microsoft.AspNetCore.Identity.IdentityUserToken`1[System.Int32],Microsoft.AspNetCore.Identity.IdentityRoleClaim`1[System.Int32]]'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AspNetCore.Identity.IUserClaimsPrincipalFactory`1[ePizzaHub.Entities.User] Lifetime: Scoped ImplementationType: Microsoft.AspNetCore.Identity.UserClaimsPrincipalFactory`2[ePizzaHub.Entities.User,ePizzaHub.Entities.Role]': Unable to resolve service for type 'ePizzaHub.Repositories.AppDbContext' while attempting to activate 'Microsoft.AspNetCore.Identity.EntityFrameworkCore.UserStore`9[ePizzaHub.Entities.User,ePizzaHub.Entities.Role,ePizzaHub.Repositories.AppDbContext,System.Int32,Microsoft.AspNetCore.Identity.IdentityUserClaim`1[System.Int32],Microsoft.AspNetCore.Identity.IdentityUserRole`1[System.Int32],Microsoft.AspNetCore.Identity.IdentityUserLogin`1[System.Int32],Microsoft.AspNetCore.Identity.IdentityUserToken`1[System.Int32],Microsoft.AspNetCore.Identity.IdentityRoleClaim`1[System.Int32]]'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AspNetCore.Identity.UserManager`1[ePizzaHub.Entities.User] Lifetime: Scoped ImplementationType: Microsoft.AspNetCore.Identity.UserManager`1[ePizzaHub.Entities.User]': Unable to resolve service for type 'ePizzaHub.Repositories.AppDbContext' while attempting to activate 'Microsoft.AspNetCore.Identity.EntityFrameworkCore.UserStore`9[ePizzaHub.Entities.User,ePizzaHub.Entities.Role,ePizzaHub.Repositories.AppDbContext,System.Int32,Microsoft.AspNetCore.Identity.IdentityUserClaim`1[System.Int32],Microsoft.AspNetCore.Identity.IdentityUserRole`1[System.Int32],Microsoft.AspNetCore.Identity.IdentityUserLogin`1[System.Int32],Microsoft.AspNetCore.Identity.IdentityUserToken`1[System.Int32],Microsoft.AspNetCore.Identity.IdentityRoleClaim`1[System.Int32]]'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AspNetCore.Identity.SignInManager`1[ePizzaHub.Entities.User] Lifetime: Scoped ImplementationType: Microsoft.AspNetCore.Identity.SignInManager`1[ePizzaHub.Entities.User]': Unable to resolve service for type 'ePizzaHub.Repositories.AppDbContext' while attempting to activate 'Microsoft.AspNetCore.Identity.EntityFrameworkCore.UserStore`9[ePizzaHub.Entities.User,ePizzaHub.Entities.Role,ePizzaHub.Repositories.AppDbContext,System.Int32,Microsoft.AspNetCore.Identity.IdentityUserClaim`1[System.Int32],Microsoft.AspNetCore.Identity.IdentityUserRole`1[System.Int32],Microsoft.AspNetCore.Identity.IdentityUserLogin`1[System.Int32],Microsoft.AspNetCore.Identity.IdentityUserToken`1[System.Int32],Microsoft.AspNetCore.Identity.IdentityRoleClaim`1[System.Int32]]'.) (Error while validating the service descriptor 'ServiceType: Microsoft.AspNetCore.Identity.RoleManager`1[ePizzaHub.Entities.Role] Lifetime: Scoped ImplementationType: Microsoft.AspNetCore.Identity.RoleManager`1[ePizzaHub.Entities.Role]': Unable to resolve service for type 'ePizzaHub.Repositories.AppDbContext' while attempting to activate
پارسال در تاریخ 1401/12/02 منتشر شده است.
15,474 بـار بازدید شده
... بیشتر