Targeting new .NET features #213
Replies: 5 comments 13 replies
-
To take full advantage of the multi-targeting and new features of the newer versions you'd have to start ifdef a lot of code. For instance nullability is one that will start to impact your code in the negative if you try to support both .net framework as well as the newest .net 6+ (although we kind of have that issue already with using netstandard 2.0). I think in some other discussion we already came to a conclusion that any support for .net framework would be best effort for any new features. And I think you came to that conclusion yourself as well? |
Beta Was this translation helpful? Give feedback.
-
We had another related problem with the cucumber messages and the System.Text.Json cucumber/messages#237. So there are several problems now related to this. Thinking it over once more: In my opinion, we should try to get a stable version with all the super important features we need (living doc, roslyn code gen, redesign conversions) and then we can stop supporting .NET Fw with newer versions (but only release bug fixes). Hopefully this is finished by the end of the year latest, so from 2025 on, we can switch to support .NET 6+. |
Beta Was this translation helpful? Give feedback.
-
Dropping .NET Standard / .NET Framework support can affect users of the library, not just plugins. For example, a .NET Standard library that needs to run under .NET 8 and .NET Framework runtime. |
Beta Was this translation helpful? Give feedback.
-
Multitargeting works if you have mostly consistent codebase, probably with some 1-2-3 I don't recommend go this way I would recommend to do it in a following way:
What problem solves this approach:
Support flow for 3.x branch:
My expectation is that year by year downloads will go down comparing with current version. We can track popularity for this via nuget statistic and probably after some years we can make a decision to drop this completely |
Beta Was this translation helpful? Give feedback.
-
Some insights about this topic: This is Automapper nuget package statistic for last 6 week Points:
as you can see - most downloaded version - version that support .NET 6. Still have some popularity version with .NET Standard 2.1 (.NET Core 3+ runtimes). Version with .NET Framework support (has .NET Standard tfm) is around 20% downloads (comparing with 11+12+13 versions) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've seen some good ideas floating around for taking advantage of features in newer versions of .NET:
Naturally, the .NET ecosystem moves forwards and we're going to see more things appear that users would want out-of-the-box support for.
Should we consider making Reqnroll target newer .NET versions to give us access to those newer APIs and be able to support these features directly? I would propose a multi-targeted library build, keeping support for .NET Framework (and others) via continuing to target .NET Standard 2.0 and adding specific targets for the currently supported .NET versions.
NuGet packages already support bundling multiple runtime target assemblies into a single package; I don't forsee complication here.
My only concern here is how it affects tests and CI. Our tests can also be made multi-targeted to run tests for each target platform, but that does add an increase in the volume of tests that will be run for builds. Parallel execution means no real increase in running time, but it will consume a lot more total time. Is that a problem or something of concern? Are there any other issues with multi-targeted tests?
Obviously sticking to a single target is a much simpler model, but .NET Standard 2.0 is getting old now, and there are new things developers are going to want to have available. I suppose there is a path forward where we stay single-target and target the oldest in-support version of .NET (version 6 until November 2024) and there's a two-year lag for new features to become supported, and the .NET Framework people are out of luck.
Are there other alternatives to this problem? Is there an aspect of multi-targeting I have missed?
Beta Was this translation helpful? Give feedback.
All reactions