Reputation: 473
how can I remove any ILookupNormalizer injection in identity core3 preview4?
I use identity 2.2 and can't use ILookupNormalizer on ApplicationUserManager. My contracture ApplicationUserManager :
public ApplicationUserManager(
IApplicationUserStore store,
IOptions<IdentityOptions> optionsAccessor,
IPasswordHasher<TblUsers> passwordHasher,
IEnumerable<IUserValidator<TblUsers>> userValidators,
IEnumerable<IPasswordValidator<TblUsers>> passwordValidators,
ILookupNormalizer keyNormalizer,
IdentityErrorDescriber errors,
IServiceProvider services,
ILogger<ApplicationUserManager> logger,
IHttpContextAccessor contextAccessor,
IUsedPasswordsService usedPasswordsService)
: base((UserStore<TblUsers, TblOrganizationChart, AbfaContext, int, TblUserClaim, TblUserOrganizationChart, TblUserLogin, TblUserToken, TblRoleClaim>)store, optionsAccessor, passwordHasher, userValidators, passwordValidators, keyNormalizer, errors, services, logger)
When I add ILookupNormalizer on AddCustomServices, I have this error:
Method 'NormalizeName' in type 'Project.Core.Identity.CS.CustomNormalizers' from assembly 'Project.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
after remove "services.AddScoped();" I have this error:
'Method 'NormalizeKey' in type 'Project.Core.Identity.ApplicationUserManager' from assembly 'Project.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.'
I don't need to use Normalizer.
How to solve this?
Upvotes: 1
Views: 1106
Reputation: 19186
The signature of ILookupNormalizer
in Identity core 3x is different than the 2x. If you want to continue using your old project and you don't want to upgrade it yet (according to the title of your question), just lock the framework version of your solution by using a global.json file. First run the dotnet --list-sdks
command to see which versions are installed. Then create a new one in the root of your solution using dotnet new globaljson --sdk-version 2.2.106
command.
dotnet --list-sdks
dotnet new globaljson --sdk-version 2.2.106
Upvotes: 5