Added Multi-TargetFrameworks#118
Conversation
|
@derek-will plz take a quick about this pr, thx! |
|
This library already supports .NET Core 3.1, .NET 5, .NET 6, .NET 7, .NET 8, and .NET 9 due to targeting .NET Standard 2.0. It actually supports many more target frameworks - You can view the list here: https://www.nuget.org/packages/SocketCANSharp/#supportedframeworks-body-tab |
U did a great job on multi-frameworks! But each framework has it's own new api, such as: /// <summary>
/// Number of the last error which indicates what went wrong. Set by system calls and some library functions when an error occurs.
/// </summary>
public static int Errno =>
#if NET6_0_OR_GREATER
Marshal.GetLastPInvokeError();
#else
Marshal.GetLastWin32Error();
#endifI want to add new api for different frameworks to make code run better :) |
|
Ah! I see! I support this change then. Great idea! Allow me a bit of time to read up on multi-framework targeting. |
|
I'm good with merging this pull request if we scale back from:
To:
Rationale is that .NET 5, 7, 9 are non-LTS releases. I see other open source .NET projects doing the same. .NET Core 3.1, although an LTS release, is just a bit too old to justify that level of support. Does this work for you? |
The targetframework in user's project can be everyone and they may not update the it for some reason. |
bro, i created a sever in discord named SocketCANSharp. Plz join it! Here is the link |
The .NET Standard library serves as the fallback library for the cases where SocketCAN# does not offer a framework-specific implementation. Targeting older and non-LTS releases increases the size of the Nuget package and requires maintenance for older unsupported and non-mainstream versions of .NET. In these circumstances, I tend to look to the giants of .NET Open Source to see what they are doing for guidance... Json.NET
Source: https://github.com/JamesNK/Newtonsoft.Json/blob/master/Src/Newtonsoft.Json/Newtonsoft.Json.csproj Command Line Parser
Source: https://github.com/commandlineparser/commandline/blob/master/src/CommandLine/CommandLine.csproj Castle Core
Source: https://github.com/castleproject/Core/blob/master/src/Castle.Core/Castle.Core.csproj Serilog
Source: https://github.com/serilog/serilog/blob/dev/src/Serilog/Serilog.csproj Serilog goes further in a comment to say....
In general, I agree with what these other developers of major projects have done. Scale back the number of TFM-specific builds to what is reasonable. For this project, I believe that to be .NET Standard 2.0, plus the active LTS versions. And while, yes, .NET 6 is technically unsupported as of this date, I am fine with the supporting it for now. |
I am considering starting a "Discussions" here. For now, please use the pull request and issue threads on GitHub. Thanks! |
Please add .NET 8 as it provides better AOT support |
For better multi-framework compatibility