Skip to content

Restore netstandard2.0 target #736

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

asherber
Copy link
Contributor

@asherber asherber commented Feb 1, 2025

It would be helpful to put back the netstandard2.0 target, so that projects which do not yet target net8.0 can continue to benefit from bug fixes and new features.

The solution compiles just fine for netstandard2.0, since there are no net8.0-specific methods in use.

@ahmad-moussawi
Copy link
Contributor

@asherber I understand the need here, but I won't be locked in an unsupported version .net, even if currently it has no compile issues, but it might refrain us from using new features in .net.

Another option could be to release a stable (3.x) version that supports old .net version

@asherber
Copy link
Contributor Author

asherber commented Feb 4, 2025

Technically, .NET Standard isn't a version of .NET -- it's an API specification which is supported by multiple runtimes (.NET Core 2.0+, .NET Framework 4.6.1+, .NET 5+). The usual advice for libraries is to stick with the lowest version that you can -- until you need new functionality that only a newer runtime provides.

I maintain several applications which use the .NET Framework -- which is still supported on current versions of Windows -- and without a .NET Standard target, I won't be able to upgrade this library. The same is true of people using .NET 6 and 7, which are also still supported.

@faddiv
Copy link

faddiv commented Feb 13, 2025

Hey @ahmad-moussawi,
I recommend using PolySharp. It somewhat helps to solve this issue. Lots of newer features only need particular attributes to be defined and this package creates it. The resulting Nuget package won't depend on another dependency.

@asherber
Copy link
Contributor Author

@faddiv That may be useful in the future, but at the moment there are no newer language features needed by this library -- it can continue to support netstandard 2.0 with no changes.

@shokurov
Copy link

shokurov commented Jul 12, 2025

I second that. In our company the standard target for all libraries is netstandard2.0, while the executables may be multitarget (net6, net8), or single target. Having SqlKata 4 targeted solely for net8.0 makes it not suitable for use in other libraries, which is essential for our scenario.

At the moment we have several extensions to SqlKata (like expression-based builders), which we thought of releasing to open source. We also are heavily using SqlKata in our database repositories, which are also packed as libraries for internal use.

@ahmad-moussawi, if using newer .Net platform features is your vision, we would be glad to support initiative for having multiple targets (net8.0, netstandard2.0). Or, as @asherber suggested, netstandard may stay a single target for now, until the new features are actually getting used.

Also, as a side note, there is no official end-of-support for netstandard2.0. All .Net standard versions are to be continually supported by new versions of .Net (https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0). Although no new versions of .Net standard after 2.1 are expected, the current versions are to be continued indefinitely, as far as I know.

Quote from the article above:

.NET Standard 2.0 is supported by all modern platforms and is the recommended way to support multiple platforms with one target.

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

Successfully merging this pull request may close these issues.

4 participants