Search code examples
asp.net-coreasp.net-identityopeniddict

Unable to add migration on dotnet


Hello everyone I am trying to add migration on my project by following code

add-migration InitialCreate

I am the facing issue while adding migration. The error says

Method not found: 'Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder`1.HasIndex

What's going on here. How to solve this????

Packages installed on my project enter image description here


Solution

  • There might problen of version mismatching. Please update your Openiddict to 2.0.1 like

    <PackageReference Include="OpenIddict" Version="2.0.1" />
    <PackageReference Include="OpenIddict.EntityFrameworkCore" Version="2.0.1" />
    <PackageReference Include="OpenIddict.Mvc" Version="2.0.1" />