Reverting to .NET Standard 2.0 #130
Replies: 6 comments
|
NuGet packages support multiple versions of libraries targerting various .NET versions. For multi-targetting, the .csproj can also target multiple versions. Ideal targets: Standard 2.0 for Framework, Standard 2.1 for Unity, .NET 10 for .NET. |
|
Use conditional compilation to get the best out of every target. - Write initially for .NET 10 and fix compilation errors conditionally. Check the .NET documentation Applies to section to find the older .NET version to conditionally compile for, even if not part of the targets. Conditional compilation can be checked for syntax errors in VS using the drop-down to switch "projects" |
|
When a package is required to expand the .NET API, include it conditionally in the csproj file. |
|
For testing - move tests to a Shared Files project and duplicate a barebone MSTest project for each target framework. Foc docs - Point DocFx to a specific framework to build against. It also seems to support a barebone form of multi-targetting through |
|
Since a lot of projects would be added and moved around, start by converting the solution to |
|
DocFX doesn't support multi-targetting. Altough it can on paper merge yamls from various builds, the command is broken since 2017. Documentation should therefore only target the .NET 10 version, with xml docs highlitghting when an api is version constraints. |
Uh oh!
There was an error while loading. Please reload this page.
For wider compatibility with existing projects across .NET Framework and possibly Unity, consider the extend of work required to revert the library project and dependencies to .NET Standard 2.0. Keeping in mind that the language version can still be explicitely defined as 14.0 and missing runtime features can be restored through official NuGet packages.
All reactions