Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support EF7 with dotnet 8 #300

Merged

Conversation

jsmith-vensure
Copy link
Contributor

@jsmith-vensure jsmith-vensure commented Oct 12, 2024

Revision of the previous PR based on feedback: #299

@a-gubskiy a-gubskiy merged commit 685853e into dncuug:master Oct 13, 2024
1 check passed
@adschmu
Copy link
Contributor

adschmu commented Oct 13, 2024

This means that EF Core package must be >= 7.0.20 and < 8.0.0. So, using any EF Core 8 version would be impossible.

I'm not aware whether the compatibility matrix would allow .NET 8 with EF Core 7 at all, but if that was the case, one could use the following:

<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.20" />

This would allow any EF Core version greater that (or equal to) 7.0.20, also 8.0.x or 9.0.x.

Unfortunately, this would also mean that everybody who has not explicitly selected a specific EF Core package version would get EF Core 7 for .NET 8.

Since the allowed minimum is also the default version, there is no way around this except switching between different target frameworks like before the proposed change.

So, if there is a demand for .NET 7 with EF Core 7, one should indeed use an additional target framework as in the original PR.

I wonder why this is problem at all, though, since building with .net7.0 should select the .net6.0 path (and hence EF Core 7) from the library? Maybe your problem can be solved by only adding the condition to the ItemGroup without adding .net7.0 as target framework?

@jsmith-vensure
Copy link
Contributor Author

jsmith-vensure commented Oct 13, 2024

The issue I experienced was because there were no explicit installs of EF7 for the target .NET 8 project, it included EF8 as a transitive dependency. Perhaps adding a package reference to EF7 directly in project would eliminate the transitive dependency issue all together. I'll verify and rollback if successful.

Thanks for the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants