Skip to content

TypeLoadException: Method 'NormalizeName' in type 'LookupNormalizer' does not have an implementation #30

@lostmsu

Description

@lostmsu

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();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions