ardalis / Specification

Base class with tests for adding specifications to a DDD model
MIT License
1.84k stars 240 forks source link

Ardalis.Specification.EntityFramework6.csproj doesn't target net7.0 or net8.0 #388

Closed mpickers closed 3 months ago

mpickers commented 3 months ago

In release 8.0 it looks like net6.0 was added as a target, but net7.0 and net8.0 were not.

<TargetFrameworks>net472;net6.0</TargetFrameworks>

Looking at the dependencies of this project they are all netstandard 2 or 2.1 targetted so should be compatible with net7.0 and net8.0 and would bring it into line with the other projects targeting the later frameworks...which would be useful for my use case.

Should be able to have target as:

<TargetFrameworks>net472;net6.0;net7.0;net8.0</TargetFrameworks>
ardalis commented 3 months ago

Everything should still work without these, right? I'm still using this package with my net8 apps no problem. If you need it, I'm not opposed to adding it, but what error are you running into?

mpickers commented 3 months ago

No specific error at this stage, just reviewing packages we use for net8 compatibility (by way of looking at what target frameworks our nuget dependencies target) for what needs attention for migrating from net6 to net8.

I realize the following is a little outside of scope, but I'll put the question out there... Do you know of a reference anywhere that states that net6 and net7 targeted packages are compatible with later versions of net core?

I have noticed that packages that don't explicitly target net8 still seem to work or nuget at least doesn't balk when adding those packages to a net8 project. However, I haven't been able to find anywhere that states that this is expected https://learn.microsoft.com/en-au/dotnet/standard/frameworks

My assumption then if this "just works" is that the only reason for targeting a specific framework is to a) Say that it's ok in net core land or b) That it targets a new set of APIs in that net core version.

ardalis commented 3 months ago

@fiseni do you know of any good reason to add more recent framework targets (or not)?

fiseni commented 3 months ago

Hi @mpickers,

We're targeting only net472;net6.0 for the EntityFramework6 package since there is no reason to do otherwise. For the EntityFrameworkCore package we're targeting net6.0;net7.0;net8.0 just because we're referencing a different major EF version for each of them. As far as the EF6 is concerned, there is no (and will not be) new major version.

If a given library targets net6.0 doesn't mean it can be consumed only by net6.0 projects. It is the minimum required version. The runtime is always backward compatible. So, if you have a net8.0 project and for some reason, you're still using EF6, you won't have any issues referencing the Ardalis.Specification.EntityFramework6 NuGet library.

mpickers commented 3 months ago

Hi @fiseni,

Greatly appreciate the explanation!

If a given library targets net6.0 doesn't mean it can be consumed only by net6.0 projects. It is the minimum required version. The runtime is always backward compatible.

This is the part I was missing. It's not obvious from the Microsoft release notes/doco. No doubt it's somewhere.

cheers Mark