Issue on EF Core query: Method not found

.net-core asp.net-core asp.net-mvc entity-framework-core

Question

I have 2 web projetcts (1 MVC and 1 API), using the same Library (.Net Core 1.1) that calls some EF Core querys... everytime I try to get data from the MVC (.Net Core 1.1) it works fine, but when I try to access it from API (.Net Core 2.0) I get the following error message:

Method not found: 'Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceCollectionBuilder2<!0,!1> Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceCollectionBuilder2.OnDelete(Microsoft.EntityFrameworkCore.Metadata.DeleteBehavior)'.

I don't think the .Net Core version would affect this since the query is called from same library

Does anyone knows how to help me ?

1
4
10/23/2017 6:39:54 PM

Accepted Answer

Issue with this problem is that you are trying to call EF core 1.1 from Dotnet core 2.2. I had same issue, I have resolved by updating everything to same version of dotnet core. In my case, data project was made on ef core 1.1 and web project was 2.0, and I updated the data project and web project to same version. In case, if you are not allowed to update to latest stable version (i.e. EF Core 2.2 and .NET Core 2.2), and then at least stick to make a call to EF Core project from same version.

0
7/4/2019 6:06:53 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow