AspNetCore.Identity.DocumentDb
AspNetCore.Identity.DocumentDb copied to clipboard
TypeLoadException: Method 'NormalizeName' in type 'LookupNormalizer' does not have an implementation
Just created new empty ASP.NET Core 3.1 project, added CodeKoenig.AspNetCore.Identity.DocumentDb, and facing this exception:
System.TypeLoadException: Method 'NormalizeName' in type 'AspNetCore.Identity.DocumentDb.LookupNormalizer' from assembly 'CodeKoenig.AspNetCore.Identity.DocumentDb, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.\r\n at AspNetCore.Identity.DocumentDb.IdentityDocumentDbBuilderExtensions.AddDocumentDbStores(IdentityBuilder builder, Action`1 setupAction)\r\n at CosmosIdentity.Startup.ConfigureServices(IServiceCollection services)
The whole project file:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CodeKoenig.AspNetCore.Identity.DocumentDb" Version="2.0.0" />
</ItemGroup>
</Project>
This is the only change I made to the template code:
public void ConfigureServices(IServiceCollection services) {
services.AddSingleton<IDocumentClient>(new DocumentClient(
serviceEndpoint: new Uri("https://localhost:8081/"),
authKeyOrResourceToken: "LOCAL"));
services.AddIdentity<DocumentDbIdentityUser, DocumentDbIdentityRole>()
.AddDocumentDbStores(options => {
options.Database = "CosmosIdentity";
options.UserStoreDocumentCollection = "AspNetIdentity";
})
.AddDefaultTokenProviders();
}
Seems to be related to 775d9e30dcc8cda58ca232f253633710c0648f5a
Any idea why .NET Standard version is not forward-compatible with .NET Core 3.1/.NET Standard 2.1?
Actually, according to https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.identity.ilookupnormalizer?view=aspnetcore-3.1 these methods should have existed in every ASP.NET Core version.
I have the same problem.
It looks like @RichMercer fixed this and had his changes merged under commit e279eae that was somehow overwritten by the later commit 775d9e3.
It's late here but I will probably have a dig tomorrow to see if I can re-instate the changes without breaking anything and create a pull request.
I was getting the same exception when I added the nuget package to my project. The exception is gone and the library works as expected however when you clone the project and reference it from your machine such as:
<ItemGroup> <ProjectReference Include="..\AspNetCore.Identity.DocumentDb\AspNetCore.Identity.DocumentDb.csproj" /> </ItemGroup>
Is there any chance on getting this fixed in the nuget package?
BTW the above fix does not work for me.
Unfortunately I do not have time to take care of this package on a regular basis - any co-maintainers would still be very welcome. I updated the project to consent with new NuGet metadata properties and published it now as version 3.0 to NuGet. It should appear shortly.
The mentioned issues should be resolved when using the most current package now, it was fixed in the repo for some time. Let me know if there are still issues.