aspnetcore: MissingMethodException: Method not found Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder

As per the blog ASP.NET Core updates in .NET Core 3.0 Preview 3 I Installed vs 2019 , dotnet new angular -au Individual after npm install, dotnet restore and running the app when I tried to register I got this error

MissingMethodException: Method not found: 'Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder`1.HasIndex(System.Linq.Expressions.Expression`1<System.Func`2<!0,System.Object>>)'.

I have tried this both on Windows and Mac and I get the same error

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 27 (20 by maintainers)

Most upvoted comments

@javiercn, Why this issue has been closed? Has it been fixed? I am still facing the same problem.

I get the same exception when using InMemory database.

@takazm This usually indicates that some packages are coming from one preview, while others are coming from a different preview or a previous release. Make sure that all packages come from the same preview/release.

However we can’t just make sure all projects reference the same version due to [incompatibilities with SQL Server 2008] (https://github.com/aspnet/EntityFrameworkCore/issues/16400). I have a single project referencing EF Core 2.2.6 whilst all other projects (in same solution) use EF Core 3.0. I can’t get around this with the current ‘Make sure all projects reference the same version’ solution! How else can this be solved? I have a single Blazor Server Side web app project referencing the different EF Core versions in the mentioned data projects. Requesting upgrading the SQL Server 2008 in our corporate environment will take forever!