reqnroll / Reqnroll

Open-source Cucumber-style BDD test automation framework for .NET.
https://reqnroll.net
BSD 3-Clause "New" or "Revised" License
302 stars 33 forks source link

Reduce target framework of Reqnroll to netstandard2.0 #130

Closed gasparnagy closed 1 month ago

gasparnagy commented 1 month ago

This PR reduces the target framework of the main Reqnroll package and many other packages to "netstandard2.0". This includes the generator project.

Related discussion: https://github.com/orgs/reqnroll/discussions/31

Besides a simpler compilation and code management, this also supports creating Reqnroll packages using single target (netstandard2.0) projects. Multi-target projects are still allowed.

All supported frameworks (.NET 4.6.2+, .NET 6.0, .NET 7.0, .NET 8.0) support .NET Standard 2.0, so this is not a breaking change.

The Reqnroll.Tools.MsBuild.Generation project is still multi-target, because msbuild.exe and Visual Studio still compiles the projects using .NET Framework (.NET 4.8) and the netstandard2.0 version of the CodeDom dependency is not compatible with .NET 4.8 (we need the copy of the .NET Framework version of the CodeDom assembly). As the Reqnroll.Tools.MsBuild.Generation is a leaf project (no one has a project reference to it), this does not generate further needs for multi-targeting.

Finally the following projects have multi-target:

The System.Runtime.Loader package we use for plugin assembly loading on modern .NET versions is not compatible with .NET Framework and we have to fall back to Assembly.LoadFrom. This was done so far with an #if pragma, now it is abstracted away with the IPluginAssemblyLoader interface and the appropriate implementation is registered (PlatformHelper.RegisterPluginAssemblyLoader).

Checklist:

gasparnagy commented 1 month ago

I did some extra exploratory testing and it seems to work.