Closed villanibr closed 4 years ago
I have the same issue with dotnet core 2.1 with EF Core 3.1.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related problems.
Summary of the issue
Microsoft recently released EF Core 3.1 and it no longer depends on .NET Standard 2.1, only on .NET Standard 2.0. This causes an issue with projects directly referencing EF Core 3.1 and targeting both Framework v4.6.1 AND .NET Standard 2.1, since your lib will try to use >= 2.2.6 for the former and >= 3.0.0 for the later. On EF Core 3.0, there are breaking changes like missing IAsyncEnumerableAccessor: "Reference to type 'IAsyncEnumerableAccessor<>' claims it is defined in 'Microsoft.EntityFrameworkCore', but it could not be found". So when building for Framework v4.6.1, your code is looking for a property on 2.2.6 that no longer exists on >= 3.0.0. Its my understanding that binding redirects won't work on this case. One possible solution is to add Microsoft.EntityFrameworkCore (>= 3.1.0) as dependency for v4.6.1 and/or .NET Standard 2.0.
Environment
Example code/Steps to reproduce:
Output: