[.NET] Reduce NuGet size by only targeting .NET Standard 2.0 #363
+7
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤔 What's changed?
⚡️ What's your motivation?
Fixes #349
The .NET tests run on different runtimes (.NET8, .NET9, .NET Framework 4.7.2).
In the github workflow (CI), Ubuntu is used to run the tests.
But Ubuntu/Linux doesn't have a Windows-only .NET Framework 4.7.2 installed.
Instead, Ubuntu used Mono to run the tests. However, as of Ubuntu 24.04, Mono is no longer installed. See actions/runner-images#10636.
This means that even on Ubuntu-22.04 the Gherkin implementation is not tested on the real .NET Framework.
This PR changes that the .NET Framework 4.7.2 runtime is only tested on Windows machines.
On the other hand, we currently have the Gherkin implementation in two flavors (.NET 8 and .NET Standard 2.0).
Both flavors use identical code and the .NET 8 specific target framework can be dropped because .NET Standard 2.0 can also be used in .NET 8 and .NET 9.
This reduces the size of NuGet package and ensures that we test all binaries we ship with the tests we run in the github workflow (CI).
Microsoft also recommends targeting only .NET Standard 2.0 if no additional features or specific APIs are required. See When to target netx.0 vs. netstandard and Cross-platform targeting.
In Reqnroll, the target framework has also been reduced to .NET Standard 2.0 only.
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
@Romfos I checked #67, but the linked Microsoft recommendation only applies to updating if you were already using one of the older frameworks (e.g. .NET 5). Am I missing something?
@gasparnagy Do you think this could be a problem in any way?
📋 Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.