-
Notifications
You must be signed in to change notification settings - Fork 593
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
Ensure target frameworks make sense for 7.0 #1189
Conversation
ff1f501
to
dc80d6a
Compare
@danielmarbach @stebet @bollhals @bording can we really move this fast and require .NET 6.0 for RabbitMQ .NET client 7.0? It seems to be very new. |
dc80d6a
to
60f02ce
Compare
Thanks @danielmarbach. This is the statement that lead me to believe
https://docs.microsoft.com/en-us/dotnet/fundamentals/implementations |
60f02ce
to
f5136de
Compare
AFAIK we don't have that information - @michaelklishin However, if we target If you haven't guessed already it has been a long time since I've had to think about framework targets. I appreciate your patience @danielmarbach |
f5136de
to
fba3869
Compare
Update packages to latest versions Fixes #1172
fba3869
to
9e76201
Compare
So I'd probably do .NET Standard 2.0 and then .NET Core 3.1 and .NET 6. Why? |
@bollhals supporting netcoreapp3.1 doesn't make sense. Even if you'd release tomorrow you'd soon have to release another major because you'd be dropping netcoreapp3.1 support when it is out of support. The customers that are on the netcoreapp3.1 have moved or are in the process of moving to Net6 since that is how net works these days since it is no longer coupled to windows updates |
@bording thoughts? I know you have a lot of insights into this whole TFM horror show 👻😂 |
Thanks again for everyone's input. I'm going to review what other .NET client library projects are doing, like |
Targeting What is the support policy for older major versions of the library? If 6.0 is going to be supported for some amount of time after 7.0 is out, then maybe Otherwise, if you want to support "older" frameworks in some capacity, then you should definitely be multi-targeting in some way. The main question to answer if you care about supporting the more obscure platforms that work with .NET Standard 2.0 or not. If you do, then going with While it is true that .NET Core 3.1 is still supported right now, it goes out of support in December, so I don't think it makes sense to keep a 3.1 target in the new major version. |
I suggest that we ship another 6.x release and reduce the number of .NET platforms we support. |
If 7.0 gives an opportunity to move completely over to just supporting the latest LTS of .NET Core, my vote would be to go for it, but that kind of depends on if there are big features coming up that people expect to be available on older frameworks. @bording Is there a reason you'd want to target .NET Standard 2.0 instead of 2.1, since I think .NET Standard 2.0 for .NET Framework projects tends to not always work correctly For .NET Framework. |
Thanks @bording. Yes we do have people using this client on Xamarin. I'm still a bit mystified about why you'd include Obviously there's a reason I don't understand, because check out these targets - https://github.com/npgsql/npgsql/blob/main/src/Npgsql/Npgsql.csproj There is no special-casing in the code, either 🤔 |
The API difference between .NET Standard 2.1 and .NET 6.0 is not a lot, but there might be a difference in the supported C# language version, although I'm not 100% on that. The main benefit in targeting .NET 6.0 is there are high-performance/low-allocation APIs available there that aren't available o previous versions, but those can be easily
|
Here is also a table for the C# language version support: https://docs.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-1#when-to-target-net50-or-net60-vs-netstandard .NET Standard 2.1 only supports C# 8 by default so there are definitely more recent language features that would be nice to be able to use such as localsinit, source generators, records, const interpolated strings etc. C# 9: https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-9 |
@stebet .NET Standard 2.1 is even more of a dead end than .NET Standard 2.0 is. The only thing that supports it is .NET Core 3.1+. My intention of having a There's basically no reason to ever use .NET Standard 2.1 and you should pretend it doesn't exist. |
@lukebakken Being able to access new APIs via #ifdefs is a primary benefit, and in some cases it's absolutely worth doing. You can also potentially avoid needing some package dependencies if you are targeting
I'm not really sure what they are doing there, either. That seems a bit excessive to me. |
``` [xUnit.net 00:00:41.19] RabbitMQ.Client.Unit.TestBlockingCell.TestBackgroundUpdateFails [FAIL] [xUnit.net 00:00:41.19] Assert.Throws() Failure [xUnit.net 00:00:41.19] Expected: typeof(System.TimeoutException) [xUnit.net 00:00:41.19] Actual: (No exception was thrown) [xUnit.net 00:00:41.19] Stack Trace: [xUnit.net 00:00:41.19] D:\a\rabbitmq-dotnet-client\rabbitmq-dotnet-client\projects\Unit\TestBlockingCell.cs(170,0): at RabbitMQ.Client.Unit.TestBlockingCell.TestBackgroundUpdateFails() Passed RabbitMQ.Client.Unit.TestBlockingCell.TestGetValueWhichDoesTimeOut [469 ms] Failed RabbitMQ.Client.Unit.TestBlockingCell.TestBackgroundUpdateFails [739 ms] Error Message: Assert.Throws() Failure Expected: typeof(System.TimeoutException) Actual: (No exception was thrown) Stack Trace: at RabbitMQ.Client.Unit.TestBlockingCell.TestBackgroundUpdateFails() in D:\a\rabbitmq-dotnet-client\rabbitmq-dotnet-client\projects\Unit\TestBlockingCell.cs:line 170 ```
Thanks everyone. I think what I have in this PR is good for now, and I will add a "7.0 Release Checklist" issue which will include an item to re-visit target frameworks if necessary. The RabbitMQ team appreciates the input! Have a great weekend! |
@stebet many language features can be shimmed into the code. For example LocalsInit is just a compiler feature. You can define the attribute as internal in your code and it will magically work. I've done that in the azure sdk. |
One PR that specifically adopts a C# 10 feature: #1202. |
Update packages to latest versions
Fixes #1172