From 36d355f1d5becce80e5af04a162f0dfc0afa2d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= Date: Tue, 21 May 2024 11:33:44 +0200 Subject: [PATCH] Reduce target framework of Reqnroll to netstandard2.0 (#130) * remove obsolete and unnecessary if pragmas * remove .NET 6.0 from target frameworks * Add PlatformInformation, fix ns Reqnroll.Compatibility to Reqnroll.PlatformCompatibility * Reduce target framework of Reqnroll project to netstandard2.0 * TEMP: Add platform information * Improve error diagnostics for plugin loader errors * Revert "TEMP: Add platform information" This reverts commit 6e08680b6e318eed052756c7d0b03d5548898b77. * add word to dictionary * Treat Mono as .NET Framework * small improvement on MainDotNetFrameworkDescription * Reduce target framework of plugin projects to netstandard2.0 * further fixes and simplifications * Replace netcoreapp3.1 with netstandard2.0 for tools and generator * Remove net6.0 from tools and generator * Temporary fix for build problem * Proper fix for build problem * project cleanup * Reduce target framework of generator projects to netstandard2.0 * Make Reqnroll.ExternalData.ReqnrollPlugin single target (netstandard2.0) * update plugins docs * cleanup targets * Make Reqnroll.MSTest.Generator.ReqnrollPlugin single target (netstandard2.0) * cleanup targets * Make Reqnroll.NUnit.Generator.ReqnrollPlugin single target (netstandard2.0) * Make Reqnroll.xUnit.Generator.ReqnrollPlugin single target (netstandard2.0) * cleanup targets * extend CHANGELOG * update ncrunch settings * small fix for Reqnroll.SpecFlowCompatibility --- .gitignore | 1 + ...l.Autofac.ReqnrollPlugin.v3.ncrunchproject | 7 +--- .../Reqnroll.CustomPlugin.v3.ncrunchproject | 3 -- ...ernalData.ReqnrollPlugin.v3.ncrunchproject | 7 +--- .ncrunch/Reqnroll.Generator.v3.ncrunchproject | 7 +--- .../Reqnroll.GeneratorTests.v3.ncrunchproject | 1 - ...Generator.ReqnrollPlugin.v3.ncrunchproject | 3 +- ...ll.MSTest.ReqnrollPlugin.v3.ncrunchproject | 3 -- ...Generator.ReqnrollPlugin.v3.ncrunchproject | 5 +-- ...oll.NUnit.ReqnrollPlugin.v3.ncrunchproject | 5 +-- .../Reqnroll.PluginTests.v3.ncrunchproject | 12 ++++++- ...Generator.ReqnrollPlugin.v3.ncrunchproject | 3 +- ...atibility.ReqnrollPlugin.v3.ncrunchproject | 3 +- ...eqnroll.Templates.DotNet.v3.ncrunchproject | 3 -- ...Tools.MsBuild.Generation.v3.ncrunchproject | 3 +- ...ll.Verify.ReqnrollPlugin.v3.ncrunchproject | 3 +- ...l.Windsor.ReqnrollPlugin.v3.ncrunchproject | 7 +--- .ncrunch/Reqnroll.v3.ncrunchproject | 6 +--- ...Generator.ReqnrollPlugin.v3.ncrunchproject | 5 +-- ...oll.xUnit.ReqnrollPlugin.v3.ncrunchproject | 5 +-- CHANGELOG.md | 1 + Directory.Build.props | 29 ++--------------- Directory.Build.targets | 10 +----- .../Reqnroll.CustomPlugin.csproj | 2 +- .../Reqnroll.CustomPlugin.nuspec | 26 +++------------ .../Reqnroll.Autofac.ReqnrollPlugin.csproj | 2 +- .../Reqnroll.Autofac.nuspec | 16 ++-------- .../build/Reqnroll.Autofac.targets | 3 +- ...Data.ReqnrollPlugin.IntegrationTest.csproj | 10 +++--- ...eqnroll.ExternalData.ReqnrollPlugin.csproj | 2 +- .../Reqnroll.ExternalData.nuspec | 4 +-- .../build/Reqnroll.ExternalData.targets | 4 +-- ...oll.MSTest.Generator.ReqnrollPlugin.csproj | 2 +- .../Reqnroll.MSTest.nuspec | 21 ++---------- .../build/MSTest.AssemblyHooks.template.cs | 10 +++++- .../build/Reqnroll.MsTest.targets | 6 ++-- .../Reqnroll.MSTest.ReqnrollPlugin.csproj | 3 +- ...roll.NUnit.Generator.ReqnrollPlugin.csproj | 2 +- .../Reqnroll.NUnit.nuspec | 21 ++---------- .../build/Reqnroll.NUnit.targets | 6 ++-- .../Reqnroll.NUnit.ReqnrollPlugin.csproj | 6 +--- .../GeneratorPlugin.cs | 2 -- ...patibility.Generator.ReqnrollPlugin.csproj | 14 ++------ .../Reqnroll.SpecFlowCompatibility.nuspec | 16 +++------- .../Reqnroll.SpecFlowCompatibility.targets | 2 +- ...pecFlowCompatibility.ReqnrollPlugin.csproj | 12 +++---- ...rify.ReqnrollPlugin.IntegrationTest.csproj | 19 ++++++----- .../Reqnroll.Verify.ReqnrollPlugin.csproj | 4 +-- .../Reqnroll.Verify.nuspec | 11 ++----- .../build/Reqnroll.Verify.targets | 2 +- .../Reqnroll.Windsor.ReqnrollPlugin.csproj | 2 +- .../Reqnroll.Windsor.nuspec | 15 ++------- .../build/Reqnroll.Windsor.targets | 4 +-- ...roll.xUnit.Generator.ReqnrollPlugin.csproj | 2 +- .../Reqnroll.xUnit.nuspec | 24 ++------------ .../build/Reqnroll.xUnit.targets | 6 ++-- .../Reqnroll.xUnit.ReqnrollPlugin.csproj | 4 ++- .../DefaultDependencyProvider.cs | 3 ++ .../Plugins/GeneratorPluginLoader.cs | 13 +++----- Reqnroll.Generator/Reqnroll.Generator.csproj | 32 ++----------------- .../Reqnroll.TestProjectGenerator.Cli.csproj | 2 +- ...Reqnroll.TestProjectGenerator.Tests.csproj | 2 +- .../Reqnroll.TestProjectGenerator.csproj | 7 ---- .../Reqnroll.Tools.MsBuild.Generation.csproj | 32 ++++++++++--------- .../Reqnroll.Tools.MsBuild.Generation.nuspec | 12 +++---- .../Reqnroll.Tools.MsBuild.Generation.props | 2 +- Reqnroll.sln.DotSettings | 3 +- Reqnroll/AssemblyAttributes.cs | 9 ------ Reqnroll/Bindings/BindingInvoker.cs | 5 --- .../Discovery/BindingSourceProcessor.cs | 2 +- .../RuntimeBindingRegistryBuilder.cs | 2 +- Reqnroll/Bindings/StepContext.cs | 2 +- Reqnroll/Configuration/ConfigurationLoader.cs | 2 +- .../DefaultDependencyProvider.cs | 2 ++ .../Infrastructure/TestExecutionEngine.cs | 2 +- .../CultureInfoHelper.cs | 2 +- Reqnroll/PlatformCompatibility/EnumHelper.cs | 2 +- .../PlatformCompatibility/ExceptionHelper.cs | 2 +- Reqnroll/PlatformCompatibility/MonoHelper.cs | 2 +- .../PlatformCompatibility/PlatformHelper.cs | 14 ++++++++ .../PlatformInformation.cs | 26 +++++++++++++++ .../DotNetFrameworkPluginAssemblyLoader.cs | 8 +++++ Reqnroll/Plugins/IPluginAssemblyLoader.cs | 7 ++++ Reqnroll/Plugins/PluginAssemblyLoader.cs | 8 +++++ Reqnroll/Plugins/PluginAssemblyResolver.cs | 4 --- Reqnroll/Plugins/RuntimePluginLoader.cs | 11 +++---- .../Plugins/RuntimePluginLocationMerger.cs | 7 +--- Reqnroll/Reqnroll.csproj | 23 +++---------- Reqnroll/Reqnroll.nuspec | 22 ++++--------- Reqnroll/Table.cs | 6 ---- Reqnroll/Tracing/AnsiColor/AnsiColor.cs | 5 +-- Reqnroll/Tracing/LanguageHelper.cs | 3 +- .../Reqnroll.GeneratorTests.csproj | 13 -------- .../Generator/GeneratorPluginLoaderTests.cs | 5 +-- .../Infrastructure/WindsorPluginTests.cs | 2 +- .../Reqnroll.RuntimeTests.csproj | 12 ------- Tests/Reqnroll.Specs/Reqnroll.Specs.csproj | 12 +++---- docs/extend/plugins.md | 31 ++++++++++++------ 98 files changed, 271 insertions(+), 507 deletions(-) create mode 100644 Reqnroll/PlatformCompatibility/PlatformHelper.cs create mode 100644 Reqnroll/PlatformCompatibility/PlatformInformation.cs create mode 100644 Reqnroll/Plugins/DotNetFrameworkPluginAssemblyLoader.cs create mode 100644 Reqnroll/Plugins/IPluginAssemblyLoader.cs create mode 100644 Reqnroll/Plugins/PluginAssemblyLoader.cs diff --git a/.gitignore b/.gitignore index 9b65f193d..c42377080 100644 --- a/.gitignore +++ b/.gitignore @@ -385,3 +385,4 @@ docs/_build/* /docs/Lib/ /docs/Scripts/ /docs/pyvenv.cfg +nCrunchTemp*.csproj diff --git a/.ncrunch/Reqnroll.Autofac.ReqnrollPlugin.v3.ncrunchproject b/.ncrunch/Reqnroll.Autofac.ReqnrollPlugin.v3.ncrunchproject index 6c4b990aa..95a483b43 100644 --- a/.ncrunch/Reqnroll.Autofac.ReqnrollPlugin.v3.ncrunchproject +++ b/.ncrunch/Reqnroll.Autofac.ReqnrollPlugin.v3.ncrunchproject @@ -1,8 +1,3 @@  - - - TargetFrameworks = net6.0 - - True - + \ No newline at end of file diff --git a/.ncrunch/Reqnroll.CustomPlugin.v3.ncrunchproject b/.ncrunch/Reqnroll.CustomPlugin.v3.ncrunchproject index 6c4b990aa..319cd523c 100644 --- a/.ncrunch/Reqnroll.CustomPlugin.v3.ncrunchproject +++ b/.ncrunch/Reqnroll.CustomPlugin.v3.ncrunchproject @@ -1,8 +1,5 @@  - - TargetFrameworks = net6.0 - True \ No newline at end of file diff --git a/.ncrunch/Reqnroll.ExternalData.ReqnrollPlugin.v3.ncrunchproject b/.ncrunch/Reqnroll.ExternalData.ReqnrollPlugin.v3.ncrunchproject index 6c4b990aa..95a483b43 100644 --- a/.ncrunch/Reqnroll.ExternalData.ReqnrollPlugin.v3.ncrunchproject +++ b/.ncrunch/Reqnroll.ExternalData.ReqnrollPlugin.v3.ncrunchproject @@ -1,8 +1,3 @@  - - - TargetFrameworks = net6.0 - - True - + \ No newline at end of file diff --git a/.ncrunch/Reqnroll.Generator.v3.ncrunchproject b/.ncrunch/Reqnroll.Generator.v3.ncrunchproject index 5448450ce..95a483b43 100644 --- a/.ncrunch/Reqnroll.Generator.v3.ncrunchproject +++ b/.ncrunch/Reqnroll.Generator.v3.ncrunchproject @@ -1,8 +1,3 @@  - - - TargetFrameworks = net6.0 - - False - + \ No newline at end of file diff --git a/.ncrunch/Reqnroll.GeneratorTests.v3.ncrunchproject b/.ncrunch/Reqnroll.GeneratorTests.v3.ncrunchproject index 9a0eea7aa..5e6d62816 100644 --- a/.ncrunch/Reqnroll.GeneratorTests.v3.ncrunchproject +++ b/.ncrunch/Reqnroll.GeneratorTests.v3.ncrunchproject @@ -1,6 +1,5 @@  True - False \ No newline at end of file diff --git a/.ncrunch/Reqnroll.MSTest.Generator.ReqnrollPlugin.v3.ncrunchproject b/.ncrunch/Reqnroll.MSTest.Generator.ReqnrollPlugin.v3.ncrunchproject index 5448450ce..e586040f3 100644 --- a/.ncrunch/Reqnroll.MSTest.Generator.ReqnrollPlugin.v3.ncrunchproject +++ b/.ncrunch/Reqnroll.MSTest.Generator.ReqnrollPlugin.v3.ncrunchproject @@ -1,8 +1,7 @@  - TargetFrameworks = net6.0 + TargetFrameworks = netstandard2.0 - False \ No newline at end of file diff --git a/.ncrunch/Reqnroll.MSTest.ReqnrollPlugin.v3.ncrunchproject b/.ncrunch/Reqnroll.MSTest.ReqnrollPlugin.v3.ncrunchproject index 5448450ce..0bcc569d0 100644 --- a/.ncrunch/Reqnroll.MSTest.ReqnrollPlugin.v3.ncrunchproject +++ b/.ncrunch/Reqnroll.MSTest.ReqnrollPlugin.v3.ncrunchproject @@ -1,8 +1,5 @@  - - TargetFrameworks = net6.0 - False \ No newline at end of file diff --git a/.ncrunch/Reqnroll.NUnit.Generator.ReqnrollPlugin.v3.ncrunchproject b/.ncrunch/Reqnroll.NUnit.Generator.ReqnrollPlugin.v3.ncrunchproject index 5448450ce..e9934c101 100644 --- a/.ncrunch/Reqnroll.NUnit.Generator.ReqnrollPlugin.v3.ncrunchproject +++ b/.ncrunch/Reqnroll.NUnit.Generator.ReqnrollPlugin.v3.ncrunchproject @@ -1,8 +1,5 @@  - - TargetFrameworks = net6.0 - - False + False \ No newline at end of file diff --git a/.ncrunch/Reqnroll.NUnit.ReqnrollPlugin.v3.ncrunchproject b/.ncrunch/Reqnroll.NUnit.ReqnrollPlugin.v3.ncrunchproject index 5448450ce..e9934c101 100644 --- a/.ncrunch/Reqnroll.NUnit.ReqnrollPlugin.v3.ncrunchproject +++ b/.ncrunch/Reqnroll.NUnit.ReqnrollPlugin.v3.ncrunchproject @@ -1,8 +1,5 @@  - - TargetFrameworks = net6.0 - - False + False \ No newline at end of file diff --git a/.ncrunch/Reqnroll.PluginTests.v3.ncrunchproject b/.ncrunch/Reqnroll.PluginTests.v3.ncrunchproject index 319cd523c..79ff1b6af 100644 --- a/.ncrunch/Reqnroll.PluginTests.v3.ncrunchproject +++ b/.ncrunch/Reqnroll.PluginTests.v3.ncrunchproject @@ -1,5 +1,15 @@  - True + + ExternalData\SampleFiles\**.* + + + + Reqnroll.PluginTests.Generator.GeneratorPluginLoaderTests.LoadPlugin_LoadXUnitSuccessfully + + + Reqnroll.PluginTests.Infrastructure.WindsorPluginTests.Can_load_Windsor_plugin + + \ No newline at end of file diff --git a/.ncrunch/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin.v3.ncrunchproject b/.ncrunch/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin.v3.ncrunchproject index 6c4b990aa..e586040f3 100644 --- a/.ncrunch/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin.v3.ncrunchproject +++ b/.ncrunch/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin.v3.ncrunchproject @@ -1,8 +1,7 @@  - TargetFrameworks = net6.0 + TargetFrameworks = netstandard2.0 - True \ No newline at end of file diff --git a/.ncrunch/Reqnroll.SpecFlowCompatibility.ReqnrollPlugin.v3.ncrunchproject b/.ncrunch/Reqnroll.SpecFlowCompatibility.ReqnrollPlugin.v3.ncrunchproject index 6c4b990aa..e586040f3 100644 --- a/.ncrunch/Reqnroll.SpecFlowCompatibility.ReqnrollPlugin.v3.ncrunchproject +++ b/.ncrunch/Reqnroll.SpecFlowCompatibility.ReqnrollPlugin.v3.ncrunchproject @@ -1,8 +1,7 @@  - TargetFrameworks = net6.0 + TargetFrameworks = netstandard2.0 - True \ No newline at end of file diff --git a/.ncrunch/Reqnroll.Templates.DotNet.v3.ncrunchproject b/.ncrunch/Reqnroll.Templates.DotNet.v3.ncrunchproject index 6c4b990aa..319cd523c 100644 --- a/.ncrunch/Reqnroll.Templates.DotNet.v3.ncrunchproject +++ b/.ncrunch/Reqnroll.Templates.DotNet.v3.ncrunchproject @@ -1,8 +1,5 @@  - - TargetFrameworks = net6.0 - True \ No newline at end of file diff --git a/.ncrunch/Reqnroll.Tools.MsBuild.Generation.v3.ncrunchproject b/.ncrunch/Reqnroll.Tools.MsBuild.Generation.v3.ncrunchproject index 5448450ce..e586040f3 100644 --- a/.ncrunch/Reqnroll.Tools.MsBuild.Generation.v3.ncrunchproject +++ b/.ncrunch/Reqnroll.Tools.MsBuild.Generation.v3.ncrunchproject @@ -1,8 +1,7 @@  - TargetFrameworks = net6.0 + TargetFrameworks = netstandard2.0 - False \ No newline at end of file diff --git a/.ncrunch/Reqnroll.Verify.ReqnrollPlugin.v3.ncrunchproject b/.ncrunch/Reqnroll.Verify.ReqnrollPlugin.v3.ncrunchproject index 6c4b990aa..e586040f3 100644 --- a/.ncrunch/Reqnroll.Verify.ReqnrollPlugin.v3.ncrunchproject +++ b/.ncrunch/Reqnroll.Verify.ReqnrollPlugin.v3.ncrunchproject @@ -1,8 +1,7 @@  - TargetFrameworks = net6.0 + TargetFrameworks = netstandard2.0 - True \ No newline at end of file diff --git a/.ncrunch/Reqnroll.Windsor.ReqnrollPlugin.v3.ncrunchproject b/.ncrunch/Reqnroll.Windsor.ReqnrollPlugin.v3.ncrunchproject index 6c4b990aa..95a483b43 100644 --- a/.ncrunch/Reqnroll.Windsor.ReqnrollPlugin.v3.ncrunchproject +++ b/.ncrunch/Reqnroll.Windsor.ReqnrollPlugin.v3.ncrunchproject @@ -1,8 +1,3 @@  - - - TargetFrameworks = net6.0 - - True - + \ No newline at end of file diff --git a/.ncrunch/Reqnroll.v3.ncrunchproject b/.ncrunch/Reqnroll.v3.ncrunchproject index e586040f3..95a483b43 100644 --- a/.ncrunch/Reqnroll.v3.ncrunchproject +++ b/.ncrunch/Reqnroll.v3.ncrunchproject @@ -1,7 +1,3 @@  - - - TargetFrameworks = netstandard2.0 - - + \ No newline at end of file diff --git a/.ncrunch/Reqnroll.xUnit.Generator.ReqnrollPlugin.v3.ncrunchproject b/.ncrunch/Reqnroll.xUnit.Generator.ReqnrollPlugin.v3.ncrunchproject index 5448450ce..cff5044ed 100644 --- a/.ncrunch/Reqnroll.xUnit.Generator.ReqnrollPlugin.v3.ncrunchproject +++ b/.ncrunch/Reqnroll.xUnit.Generator.ReqnrollPlugin.v3.ncrunchproject @@ -1,8 +1,5 @@  - - TargetFrameworks = net6.0 - - False + False \ No newline at end of file diff --git a/.ncrunch/Reqnroll.xUnit.ReqnrollPlugin.v3.ncrunchproject b/.ncrunch/Reqnroll.xUnit.ReqnrollPlugin.v3.ncrunchproject index 5448450ce..cff5044ed 100644 --- a/.ncrunch/Reqnroll.xUnit.ReqnrollPlugin.v3.ncrunchproject +++ b/.ncrunch/Reqnroll.xUnit.ReqnrollPlugin.v3.ncrunchproject @@ -1,8 +1,5 @@  - - TargetFrameworks = net6.0 - - False + False \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 21531040e..37652b5a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * Fix: #111 @ignore attribute is not inherited to the scenarios from Rule * Support for JSON files added to SpecFlow.ExternalData * Fix: #120 Capture ExecutionContext after every binding invoke +* Allow creating single target (netstandard2.0) plugins * MsTest: Use ClassCleanupBehavior.EndOfClass instead of custom implementation (preparation for MsTest v4.0) * Fix: #71 StackOverflowException when using [StepArgumentTransformation] with same input and output type (for example string) diff --git a/Directory.Build.props b/Directory.Build.props index 3d9127a80..0395695cd 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -36,32 +36,9 @@ - net462 - - net6.0 - - - $(Reqnroll_FullFramework_TFM) - netstandard2.0 - - $(Reqnroll_FullFramework_TFM) - netcoreapp3.1 - - $(Reqnroll_FullFramework_TFM) - netcoreapp3.1;net6.0 - - $(Reqnroll_FullFramework_TFM) - $(Reqnroll_Net6_TFM) - - $(Reqnroll_FullFramework_TFM) - netcoreapp3.1 - $(Reqnroll_Net6_TFM) - - $(Reqnroll_FullFramework_Runtime_TFM);$(Reqnroll_Core_Runtime_TFM);$(Reqnroll_Net6_TFM) - $(Reqnroll_FullFramework_Generator_TFM);$(Reqnroll_Core_Generator_TFM);$(Reqnroll_Net6_TFM) - $(Reqnroll_FullFramework_Test_TFM);$(Reqnroll_Core_Test_TFM) - $(Reqnroll_Net6_Specs_TFM) - $(Reqnroll_FullFramework_Tools_TFM);$(Reqnroll_Core_Tools_TFM);$(Reqnroll_Net6_Tools_TFM) + + net462 + netstandard2.0 true diff --git a/Directory.Build.targets b/Directory.Build.targets index c01395040..4d2d2a4c0 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -8,16 +8,8 @@ $(NuspecProperties);author=$(Reqnroll_Authors) $(NuspecProperties);owner=$(Reqnroll_Owners) - $(NuspecProperties);Reqnroll_Net6_TFM=$(Reqnroll_Net6_TFM) - - $(NuspecProperties);Reqnroll_FullFramework_Runtime_TFM=$(Reqnroll_FullFramework_Runtime_TFM) - $(NuspecProperties);Reqnroll_Core_Runtime_TFM=$(Reqnroll_Core_Runtime_TFM) - - $(NuspecProperties);Reqnroll_FullFramework_Generator_TFM=$(Reqnroll_FullFramework_Generator_TFM) - $(NuspecProperties);Reqnroll_Core_Generator_TFM=$(Reqnroll_Core_Generator_TFM) - + $(NuspecProperties);Reqnroll_FullFramework_Tools_TFM=$(Reqnroll_FullFramework_Tools_TFM) $(NuspecProperties);Reqnroll_Core_Tools_TFM=$(Reqnroll_Core_Tools_TFM) - $(NuspecProperties);Reqnroll_Net6_Tools_TFM=$(Reqnroll_Net6_Tools_TFM) diff --git a/Installer/Reqnroll.CustomPlugin/Reqnroll.CustomPlugin.csproj b/Installer/Reqnroll.CustomPlugin/Reqnroll.CustomPlugin.csproj index 497cd9a02..bc4b0f3d0 100644 --- a/Installer/Reqnroll.CustomPlugin/Reqnroll.CustomPlugin.csproj +++ b/Installer/Reqnroll.CustomPlugin/Reqnroll.CustomPlugin.csproj @@ -1,7 +1,7 @@ - $(Reqnroll_Generator_TFM) + netstandard2.0 $(MSBuildThisFileDirectory)Reqnroll.CustomPlugin.nuspec true diff --git a/Installer/Reqnroll.CustomPlugin/Reqnroll.CustomPlugin.nuspec b/Installer/Reqnroll.CustomPlugin/Reqnroll.CustomPlugin.nuspec index 2b424d2c9..d37fd9818 100644 --- a/Installer/Reqnroll.CustomPlugin/Reqnroll.CustomPlugin.nuspec +++ b/Installer/Reqnroll.CustomPlugin/Reqnroll.CustomPlugin.nuspec @@ -17,33 +17,15 @@ $copyright$ - - - - - - - - - - - - - - - - - - - - - - + + + + diff --git a/Plugins/Reqnroll.Autofac.ReqnrollPlugin/Reqnroll.Autofac.ReqnrollPlugin.csproj b/Plugins/Reqnroll.Autofac.ReqnrollPlugin/Reqnroll.Autofac.ReqnrollPlugin.csproj index 486be9ecb..a5fd3ba84 100644 --- a/Plugins/Reqnroll.Autofac.ReqnrollPlugin/Reqnroll.Autofac.ReqnrollPlugin.csproj +++ b/Plugins/Reqnroll.Autofac.ReqnrollPlugin/Reqnroll.Autofac.ReqnrollPlugin.csproj @@ -1,6 +1,6 @@ - $(Reqnroll_Runtime_TFM) + netstandard2.0 $(Reqnroll_KeyFile) $(Reqnroll_EnableStrongNameSigning) $(Reqnroll_PublicSign) diff --git a/Plugins/Reqnroll.Autofac.ReqnrollPlugin/Reqnroll.Autofac.nuspec b/Plugins/Reqnroll.Autofac.ReqnrollPlugin/Reqnroll.Autofac.nuspec index 7b6bd05d4..20aaf3f77 100644 --- a/Plugins/Reqnroll.Autofac.ReqnrollPlugin/Reqnroll.Autofac.nuspec +++ b/Plugins/Reqnroll.Autofac.ReqnrollPlugin/Reqnroll.Autofac.nuspec @@ -16,29 +16,17 @@ LICENSE reqnroll autofac di dependency injection - - - - - - - - - - - - - - + + diff --git a/Plugins/Reqnroll.Autofac.ReqnrollPlugin/build/Reqnroll.Autofac.targets b/Plugins/Reqnroll.Autofac.ReqnrollPlugin/build/Reqnroll.Autofac.targets index c1700e37d..1ff367c1d 100644 --- a/Plugins/Reqnroll.Autofac.ReqnrollPlugin/build/Reqnroll.Autofac.targets +++ b/Plugins/Reqnroll.Autofac.ReqnrollPlugin/build/Reqnroll.Autofac.targets @@ -1,8 +1,7 @@ - <_Reqnroll_AutofacPluginFramework Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' ">netstandard2.0 - <_Reqnroll_AutofacPluginFramework Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' ">net462 + <_Reqnroll_AutofacPluginFramework>netstandard2.0 <_Reqnroll_AutofacPluginPath>$(MSBuildThisFileDirectory)\..\lib\$(_Reqnroll_AutofacPluginFramework)\Reqnroll.Autofac.ReqnrollPlugin.dll diff --git a/Plugins/Reqnroll.ExternalData/Reqnroll.ExternalData.ReqnrollPlugin.IntegrationTest/Reqnroll.ExternalData.ReqnrollPlugin.IntegrationTest.csproj b/Plugins/Reqnroll.ExternalData/Reqnroll.ExternalData.ReqnrollPlugin.IntegrationTest/Reqnroll.ExternalData.ReqnrollPlugin.IntegrationTest.csproj index 0641b57a0..abf210a9a 100644 --- a/Plugins/Reqnroll.ExternalData/Reqnroll.ExternalData.ReqnrollPlugin.IntegrationTest/Reqnroll.ExternalData.ReqnrollPlugin.IntegrationTest.csproj +++ b/Plugins/Reqnroll.ExternalData/Reqnroll.ExternalData.ReqnrollPlugin.IntegrationTest/Reqnroll.ExternalData.ReqnrollPlugin.IntegrationTest.csproj @@ -24,21 +24,21 @@ - <_Reqnroll_Needed_MSBuildGenerator Condition=" '$(MSBuildRuntimeType)' == 'Core'">$(Reqnroll_Core_Generator_TFM) - <_Reqnroll_Needed_MSBuildGenerator Condition=" '$(MSBuildRuntimeType)' != 'Core'">$(Reqnroll_FullFramework_Generator_TFM) + <_Reqnroll_Needed_MSBuildGenerator Condition=" '$(MSBuildRuntimeType)' == 'Core'">$(Reqnroll_Core_Tools_TFM) + <_Reqnroll_Needed_MSBuildGenerator Condition=" '$(MSBuildRuntimeType)' != 'Core'">$(Reqnroll_FullFramework_Tools_TFM) - + - + - <_Reqnroll_TaskAssembly>..\..\Reqnroll.Tools.MsBuild.Generation\bin\$(Configuration)\$(_Reqnroll_Needed_MSBuildGenerator)\Reqnroll.Tools.MsBuild.Generation.dll + <_Reqnroll_TaskAssembly>..\..\Reqnroll.Tools.MsBuild.Generation\bin\$(Configuration)\$(_Reqnroll_Needed_MSBuildGenerator)\tasks\Reqnroll.Tools.MsBuild.Generation.dll diff --git a/Plugins/Reqnroll.ExternalData/Reqnroll.ExternalData.ReqnrollPlugin/Reqnroll.ExternalData.ReqnrollPlugin.csproj b/Plugins/Reqnroll.ExternalData/Reqnroll.ExternalData.ReqnrollPlugin/Reqnroll.ExternalData.ReqnrollPlugin.csproj index de7e5ad16..37ba8799a 100644 --- a/Plugins/Reqnroll.ExternalData/Reqnroll.ExternalData.ReqnrollPlugin/Reqnroll.ExternalData.ReqnrollPlugin.csproj +++ b/Plugins/Reqnroll.ExternalData/Reqnroll.ExternalData.ReqnrollPlugin/Reqnroll.ExternalData.ReqnrollPlugin.csproj @@ -1,6 +1,6 @@ - $(Reqnroll_Generator_TFM) + netstandard2.0 $(MSBuildThisFileDirectory)Reqnroll.ExternalData.nuspec $(Reqnroll_KeyFile) $(Reqnroll_EnableStrongNameSigning) diff --git a/Plugins/Reqnroll.ExternalData/Reqnroll.ExternalData.ReqnrollPlugin/Reqnroll.ExternalData.nuspec b/Plugins/Reqnroll.ExternalData/Reqnroll.ExternalData.ReqnrollPlugin/Reqnroll.ExternalData.nuspec index ba9370439..51ee2bd2b 100644 --- a/Plugins/Reqnroll.ExternalData/Reqnroll.ExternalData.ReqnrollPlugin/Reqnroll.ExternalData.nuspec +++ b/Plugins/Reqnroll.ExternalData/Reqnroll.ExternalData.ReqnrollPlugin/Reqnroll.ExternalData.nuspec @@ -21,9 +21,7 @@ - - - + diff --git a/Plugins/Reqnroll.ExternalData/Reqnroll.ExternalData.ReqnrollPlugin/build/Reqnroll.ExternalData.targets b/Plugins/Reqnroll.ExternalData/Reqnroll.ExternalData.ReqnrollPlugin/build/Reqnroll.ExternalData.targets index e2525b081..887d91c64 100644 --- a/Plugins/Reqnroll.ExternalData/Reqnroll.ExternalData.ReqnrollPlugin/build/Reqnroll.ExternalData.targets +++ b/Plugins/Reqnroll.ExternalData/Reqnroll.ExternalData.ReqnrollPlugin/build/Reqnroll.ExternalData.targets @@ -1,9 +1,7 @@ - <_ExternalDataGeneratorPluginFramework Condition=" '$(MSBuildRuntimeType)' == 'Core'">netcoreapp3.1 - <_ExternalDataGeneratorPluginFramework Condition=" '$(MSBuildRuntimeType)' != 'Core'">net462 + <_ExternalDataGeneratorPluginFramework>netstandard2.0 <_ExternalDataGeneratorPluginPath>$(MSBuildThisFileDirectory)$(_ExternalDataGeneratorPluginFramework)\Reqnroll.ExternalData.ReqnrollPlugin.dll - \ No newline at end of file diff --git a/Plugins/Reqnroll.MSTest.Generator.ReqnrollPlugin/Reqnroll.MSTest.Generator.ReqnrollPlugin.csproj b/Plugins/Reqnroll.MSTest.Generator.ReqnrollPlugin/Reqnroll.MSTest.Generator.ReqnrollPlugin.csproj index 8b415f5d0..216d841d0 100644 --- a/Plugins/Reqnroll.MSTest.Generator.ReqnrollPlugin/Reqnroll.MSTest.Generator.ReqnrollPlugin.csproj +++ b/Plugins/Reqnroll.MSTest.Generator.ReqnrollPlugin/Reqnroll.MSTest.Generator.ReqnrollPlugin.csproj @@ -1,6 +1,6 @@ - $(Reqnroll_Generator_TFM) + netstandard2.0 $(MSBuildThisFileDirectory)Reqnroll.MSTest.nuspec $(Reqnroll_KeyFile) $(Reqnroll_EnableStrongNameSigning) diff --git a/Plugins/Reqnroll.MSTest.Generator.ReqnrollPlugin/Reqnroll.MSTest.nuspec b/Plugins/Reqnroll.MSTest.Generator.ReqnrollPlugin/Reqnroll.MSTest.nuspec index 94e7a2a45..accdf6f86 100644 --- a/Plugins/Reqnroll.MSTest.Generator.ReqnrollPlugin/Reqnroll.MSTest.nuspec +++ b/Plugins/Reqnroll.MSTest.Generator.ReqnrollPlugin/Reqnroll.MSTest.nuspec @@ -16,35 +16,20 @@ reqnroll mstest $copyright$ - - - - - - - - - - - - - - + - - - - + + diff --git a/Plugins/Reqnroll.MSTest.Generator.ReqnrollPlugin/build/MSTest.AssemblyHooks.template.cs b/Plugins/Reqnroll.MSTest.Generator.ReqnrollPlugin/build/MSTest.AssemblyHooks.template.cs index c67a9d7e7..93076d137 100644 --- a/Plugins/Reqnroll.MSTest.Generator.ReqnrollPlugin/build/MSTest.AssemblyHooks.template.cs +++ b/Plugins/Reqnroll.MSTest.Generator.ReqnrollPlugin/build/MSTest.AssemblyHooks.template.cs @@ -20,7 +20,15 @@ public static async Task AssemblyInitializeAsync(TestContext testContext) var currentAssembly = typeof(PROJECT_ROOT_NAMESPACE_MSTestAssemblyHooks).Assembly; var containerBuilder = new MsTestContainerBuilder(testContext); - await global::Reqnroll.TestRunnerManager.OnTestRunStartAsync(currentAssembly, containerBuilder: containerBuilder); + try + { + await global::Reqnroll.TestRunnerManager.OnTestRunStartAsync(currentAssembly, containerBuilder: containerBuilder); + } + catch (System.Exception ex) + { + // wrap the exception because MsTest swallows the outer exception + throw new System.AggregateException(ex); + } } [AssemblyCleanup] diff --git a/Plugins/Reqnroll.MSTest.Generator.ReqnrollPlugin/build/Reqnroll.MsTest.targets b/Plugins/Reqnroll.MSTest.Generator.ReqnrollPlugin/build/Reqnroll.MsTest.targets index b0e411f8c..7be4cb065 100644 --- a/Plugins/Reqnroll.MSTest.Generator.ReqnrollPlugin/build/Reqnroll.MsTest.targets +++ b/Plugins/Reqnroll.MSTest.Generator.ReqnrollPlugin/build/Reqnroll.MsTest.targets @@ -17,12 +17,10 @@ - <_Reqnroll_MsTestGeneratorPlugin Condition=" '$(MSBuildRuntimeType)' == 'Core'">netcoreapp3.1 - <_Reqnroll_MsTestGeneratorPlugin Condition=" '$(MSBuildRuntimeType)' != 'Core'">net462 + <_Reqnroll_MsTestGeneratorPlugin>netstandard2.0 <_Reqnroll_MsTestGeneratorPluginPath>$(MSBuildThisFileDirectory)\$(_Reqnroll_MsTestGeneratorPlugin)\Reqnroll.MSTest.Generator.ReqnrollPlugin.dll - <_Reqnroll_MsTestRuntimePlugin Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' ">netstandard2.0 - <_Reqnroll_MsTestRuntimePlugin Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' ">net462 + <_Reqnroll_MsTestRuntimePlugin>netstandard2.0 <_Reqnroll_MsTestRuntimePluginPath>$(MSBuildThisFileDirectory)\..\lib\$(_Reqnroll_MsTestRuntimePlugin)\Reqnroll.MSTest.ReqnrollPlugin.dll $(MSBuildThisFileDirectory)MSTest.AssemblyHooks$(DefaultLanguageSourceExtension) diff --git a/Plugins/Reqnroll.MSTest.ReqnrollPlugin/Reqnroll.MSTest.ReqnrollPlugin.csproj b/Plugins/Reqnroll.MSTest.ReqnrollPlugin/Reqnroll.MSTest.ReqnrollPlugin.csproj index 1de872a2c..928684ecc 100644 --- a/Plugins/Reqnroll.MSTest.ReqnrollPlugin/Reqnroll.MSTest.ReqnrollPlugin.csproj +++ b/Plugins/Reqnroll.MSTest.ReqnrollPlugin/Reqnroll.MSTest.ReqnrollPlugin.csproj @@ -1,6 +1,6 @@ - $(Reqnroll_Runtime_TFM) + netstandard2.0 $(Reqnroll_KeyFile) $(Reqnroll_EnableStrongNameSigning) $(Reqnroll_PublicSign) @@ -15,7 +15,6 @@ all runtime; build; native; contentfiles; analyzers - diff --git a/Plugins/Reqnroll.NUnit.Generator.ReqnrollPlugin/Reqnroll.NUnit.Generator.ReqnrollPlugin.csproj b/Plugins/Reqnroll.NUnit.Generator.ReqnrollPlugin/Reqnroll.NUnit.Generator.ReqnrollPlugin.csproj index 5cb39fec0..243b1dec7 100644 --- a/Plugins/Reqnroll.NUnit.Generator.ReqnrollPlugin/Reqnroll.NUnit.Generator.ReqnrollPlugin.csproj +++ b/Plugins/Reqnroll.NUnit.Generator.ReqnrollPlugin/Reqnroll.NUnit.Generator.ReqnrollPlugin.csproj @@ -1,6 +1,6 @@ - $(Reqnroll_Generator_TFM) + netstandard2.0 $(MSBuildThisFileDirectory)Reqnroll.NUnit.nuspec $(Reqnroll_KeyFile) $(Reqnroll_EnableStrongNameSigning) diff --git a/Plugins/Reqnroll.NUnit.Generator.ReqnrollPlugin/Reqnroll.NUnit.nuspec b/Plugins/Reqnroll.NUnit.Generator.ReqnrollPlugin/Reqnroll.NUnit.nuspec index 5618ab73b..dc12ee964 100644 --- a/Plugins/Reqnroll.NUnit.Generator.ReqnrollPlugin/Reqnroll.NUnit.nuspec +++ b/Plugins/Reqnroll.NUnit.Generator.ReqnrollPlugin/Reqnroll.NUnit.nuspec @@ -16,35 +16,20 @@ reqnroll nunit $copyright$ - - - - - - - - - - - - - - + - - - - + + diff --git a/Plugins/Reqnroll.NUnit.Generator.ReqnrollPlugin/build/Reqnroll.NUnit.targets b/Plugins/Reqnroll.NUnit.Generator.ReqnrollPlugin/build/Reqnroll.NUnit.targets index c9273cf1d..30c4f4456 100644 --- a/Plugins/Reqnroll.NUnit.Generator.ReqnrollPlugin/build/Reqnroll.NUnit.targets +++ b/Plugins/Reqnroll.NUnit.Generator.ReqnrollPlugin/build/Reqnroll.NUnit.targets @@ -17,12 +17,10 @@ - <_Reqnroll_NUnitGeneratorPlugin Condition=" '$(MSBuildRuntimeType)' == 'Core'">netcoreapp3.1 - <_Reqnroll_NUnitGeneratorPlugin Condition=" '$(MSBuildRuntimeType)' != 'Core'">net462 + <_Reqnroll_NUnitGeneratorPlugin>netstandard2.0 <_Reqnroll_NUnitGeneratorPluginPath>$(MSBuildThisFileDirectory)\$(_Reqnroll_NUnitGeneratorPlugin)\Reqnroll.NUnit.Generator.ReqnrollPlugin.dll - <_Reqnroll_NUnitRuntimePlugin Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' ">netstandard2.0 - <_Reqnroll_NUnitRuntimePlugin Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' ">net462 + <_Reqnroll_NUnitRuntimePlugin>netstandard2.0 <_Reqnroll_NUnitRuntimePluginPath>$(MSBuildThisFileDirectory)\..\lib\$(_Reqnroll_NUnitRuntimePlugin)\Reqnroll.NUnit.ReqnrollPlugin.dll $(MSBuildThisFileDirectory)NUnit.AssemblyHooks$(DefaultLanguageSourceExtension) diff --git a/Plugins/Reqnroll.NUnit.ReqnrollPlugin/Reqnroll.NUnit.ReqnrollPlugin.csproj b/Plugins/Reqnroll.NUnit.ReqnrollPlugin/Reqnroll.NUnit.ReqnrollPlugin.csproj index 6842cfb26..9eb93ad40 100644 --- a/Plugins/Reqnroll.NUnit.ReqnrollPlugin/Reqnroll.NUnit.ReqnrollPlugin.csproj +++ b/Plugins/Reqnroll.NUnit.ReqnrollPlugin/Reqnroll.NUnit.ReqnrollPlugin.csproj @@ -1,9 +1,6 @@ - $(Reqnroll_Runtime_TFM) - $(Reqnroll_KeyFile) - $(Reqnroll_EnableStrongNameSigning) - $(Reqnroll_PublicSign) + netstandard2.0 $(Reqnroll_KeyFile) $(Reqnroll_EnableStrongNameSigning) $(Reqnroll_PublicSign) @@ -18,7 +15,6 @@ all runtime; build; native; contentfiles; analyzers - diff --git a/Plugins/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin/GeneratorPlugin.cs b/Plugins/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin/GeneratorPlugin.cs index 4887e2234..b724beca8 100644 --- a/Plugins/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin/GeneratorPlugin.cs +++ b/Plugins/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin/GeneratorPlugin.cs @@ -13,7 +13,6 @@ public class GeneratorPlugin : IGeneratorPlugin { public void Initialize(GeneratorPluginEvents generatorPluginEvents, GeneratorPluginParameters generatorPluginParameters, UnitTestProviderConfiguration unitTestProviderConfiguration) { -#if NETFRAMEWORK generatorPluginEvents.ConfigurationDefaults += (_, args) => { var configuration = args.ReqnrollProjectConfiguration.ReqnrollConfiguration; @@ -24,6 +23,5 @@ public void Initialize(GeneratorPluginEvents generatorPluginEvents, GeneratorPlu loader.UpdateFromAppConfig(configuration, configSection); } }; -#endif } } \ No newline at end of file diff --git a/Plugins/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin.csproj b/Plugins/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin.csproj index 440c2abbd..3d871baa8 100644 --- a/Plugins/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin.csproj +++ b/Plugins/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin.csproj @@ -1,6 +1,6 @@  - $(Reqnroll_Generator_TFM) + netstandard2.0;net462 $(MSBuildThisFileDirectory)Reqnroll.SpecFlowCompatibility.nuspec $(Reqnroll_KeyFile) $(Reqnroll_EnableStrongNameSigning) @@ -17,22 +17,12 @@ all runtime; build; native; contentfiles; analyzers - - - false - - - - - - - AppConfig\%(RecursiveDir)%(Filename)%(Extension) - + diff --git a/Plugins/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin/Reqnroll.SpecFlowCompatibility.nuspec b/Plugins/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin/Reqnroll.SpecFlowCompatibility.nuspec index d6b91b9bc..ee051fbd3 100644 --- a/Plugins/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin/Reqnroll.SpecFlowCompatibility.nuspec +++ b/Plugins/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin/Reqnroll.SpecFlowCompatibility.nuspec @@ -22,23 +22,17 @@ - - - - - - - + + + - - - - + + diff --git a/Plugins/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin/build/Reqnroll.SpecFlowCompatibility.targets b/Plugins/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin/build/Reqnroll.SpecFlowCompatibility.targets index 76b58aad8..77cfcf43e 100644 --- a/Plugins/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin/build/Reqnroll.SpecFlowCompatibility.targets +++ b/Plugins/Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin/build/Reqnroll.SpecFlowCompatibility.targets @@ -2,7 +2,7 @@ - <_Reqnroll_SpecFlowCompatibilityGeneratorPlugin Condition=" '$(MSBuildRuntimeType)' == 'Core'">netcoreapp3.1 + <_Reqnroll_SpecFlowCompatibilityGeneratorPlugin Condition=" '$(MSBuildRuntimeType)' == 'Core'">netstandard2.0 <_Reqnroll_SpecFlowCompatibilityGeneratorPlugin Condition=" '$(MSBuildRuntimeType)' != 'Core'">net462 <_Reqnroll_SpecFlowCompatibilityGeneratorPluginPath>$(MSBuildThisFileDirectory)\$(_Reqnroll_SpecFlowCompatibilityGeneratorPlugin)\Reqnroll.SpecFlowCompatibility.Generator.ReqnrollPlugin.dll diff --git a/Plugins/Reqnroll.SpecFlowCompatibility.ReqnrollPlugin/Reqnroll.SpecFlowCompatibility.ReqnrollPlugin.csproj b/Plugins/Reqnroll.SpecFlowCompatibility.ReqnrollPlugin/Reqnroll.SpecFlowCompatibility.ReqnrollPlugin.csproj index 45e89d292..f36633d45 100644 --- a/Plugins/Reqnroll.SpecFlowCompatibility.ReqnrollPlugin/Reqnroll.SpecFlowCompatibility.ReqnrollPlugin.csproj +++ b/Plugins/Reqnroll.SpecFlowCompatibility.ReqnrollPlugin/Reqnroll.SpecFlowCompatibility.ReqnrollPlugin.csproj @@ -1,6 +1,6 @@  - $(Reqnroll_Runtime_TFM) + netstandard2.0;net462 $(Reqnroll_KeyFile) $(Reqnroll_EnableStrongNameSigning) $(Reqnroll_PublicSign) @@ -18,15 +18,11 @@ - - - - - + - - + + \ No newline at end of file diff --git a/Plugins/Reqnroll.Verify/Reqnroll.Verify.ReqnrollPlugin.IntegrationTest/Reqnroll.Verify.ReqnrollPlugin.IntegrationTest.csproj b/Plugins/Reqnroll.Verify/Reqnroll.Verify.ReqnrollPlugin.IntegrationTest/Reqnroll.Verify.ReqnrollPlugin.IntegrationTest.csproj index c035f9d91..fb0f900c3 100644 --- a/Plugins/Reqnroll.Verify/Reqnroll.Verify.ReqnrollPlugin.IntegrationTest/Reqnroll.Verify.ReqnrollPlugin.IntegrationTest.csproj +++ b/Plugins/Reqnroll.Verify/Reqnroll.Verify.ReqnrollPlugin.IntegrationTest/Reqnroll.Verify.ReqnrollPlugin.IntegrationTest.csproj @@ -1,4 +1,4 @@ - + @@ -30,19 +30,22 @@ - <_Reqnroll_Needed_MSBuildGenerator Condition=" '$(MSBuildRuntimeType)' == 'Core'">$(Reqnroll_Core_Generator_TFM) - <_Reqnroll_Needed_MSBuildGenerator Condition=" '$(MSBuildRuntimeType)' != 'Core'">$(Reqnroll_FullFramework_Generator_TFM) + <_Reqnroll_Needed_MSBuildGenerator Condition=" '$(MSBuildRuntimeType)' == 'Core'">$(Reqnroll_Core_Tools_TFM) + <_Reqnroll_Needed_MSBuildGenerator Condition=" '$(MSBuildRuntimeType)' != 'Core'">$(Reqnroll_FullFramework_Tools_TFM) + + <_VerifyGeneratorPluginFramework Condition=" '$(MSBuildRuntimeType)' == 'Core'">netstandard2.0 + <_VerifyGeneratorPluginFramework Condition=" '$(MSBuildRuntimeType)' != 'Core'">net462 - - + + - - + + @@ -50,7 +53,7 @@ - <_Reqnroll_TaskAssembly>..\..\Reqnroll.Tools.MsBuild.Generation\bin\$(Configuration)\$(_Reqnroll_Needed_MSBuildGenerator)\Reqnroll.Tools.MsBuild.Generation.dll + <_Reqnroll_TaskAssembly>..\..\Reqnroll.Tools.MsBuild.Generation\bin\$(Configuration)\$(_Reqnroll_Needed_MSBuildGenerator)\tasks\Reqnroll.Tools.MsBuild.Generation.dll diff --git a/Plugins/Reqnroll.Verify/Reqnroll.Verify.ReqnrollPlugin/Reqnroll.Verify.ReqnrollPlugin.csproj b/Plugins/Reqnroll.Verify/Reqnroll.Verify.ReqnrollPlugin/Reqnroll.Verify.ReqnrollPlugin.csproj index 58723e760..a6aec9b9e 100644 --- a/Plugins/Reqnroll.Verify/Reqnroll.Verify.ReqnrollPlugin/Reqnroll.Verify.ReqnrollPlugin.csproj +++ b/Plugins/Reqnroll.Verify/Reqnroll.Verify.ReqnrollPlugin/Reqnroll.Verify.ReqnrollPlugin.csproj @@ -1,6 +1,6 @@ - + - $(Reqnroll_Generator_TFM) + net462;netstandard2.0 $(MSBuildThisFileDirectory)Reqnroll.Verify.nuspec $(Reqnroll_KeyFile) $(Reqnroll_EnableStrongNameSigning) diff --git a/Plugins/Reqnroll.Verify/Reqnroll.Verify.ReqnrollPlugin/Reqnroll.Verify.nuspec b/Plugins/Reqnroll.Verify/Reqnroll.Verify.ReqnrollPlugin/Reqnroll.Verify.nuspec index bf72de566..fb893ba03 100644 --- a/Plugins/Reqnroll.Verify/Reqnroll.Verify.ReqnrollPlugin/Reqnroll.Verify.nuspec +++ b/Plugins/Reqnroll.Verify/Reqnroll.Verify.ReqnrollPlugin/Reqnroll.Verify.nuspec @@ -20,11 +20,7 @@ - - - - - + @@ -35,11 +31,10 @@ - + - - + diff --git a/Plugins/Reqnroll.Verify/Reqnroll.Verify.ReqnrollPlugin/build/Reqnroll.Verify.targets b/Plugins/Reqnroll.Verify/Reqnroll.Verify.ReqnrollPlugin/build/Reqnroll.Verify.targets index dfa8e8105..1b5945aaf 100644 --- a/Plugins/Reqnroll.Verify/Reqnroll.Verify.ReqnrollPlugin/build/Reqnroll.Verify.targets +++ b/Plugins/Reqnroll.Verify/Reqnroll.Verify.ReqnrollPlugin/build/Reqnroll.Verify.targets @@ -1,6 +1,6 @@ - <_VerifyGeneratorPluginFramework Condition=" '$(MSBuildRuntimeType)' == 'Core'">netcoreapp3.1 + <_VerifyGeneratorPluginFramework Condition=" '$(MSBuildRuntimeType)' == 'Core'">netstandard2.0 <_VerifyGeneratorPluginFramework Condition=" '$(MSBuildRuntimeType)' != 'Core'">net462 <_VerifyGeneratorPluginPath>$(MSBuildThisFileDirectory)$(_VerifyGeneratorPluginFramework)\Reqnroll.Verify.ReqnrollPlugin.dll diff --git a/Plugins/Reqnroll.Windsor.ReqnrollPlugin/Reqnroll.Windsor.ReqnrollPlugin.csproj b/Plugins/Reqnroll.Windsor.ReqnrollPlugin/Reqnroll.Windsor.ReqnrollPlugin.csproj index 9ce8dfaf1..b9e35ec99 100644 --- a/Plugins/Reqnroll.Windsor.ReqnrollPlugin/Reqnroll.Windsor.ReqnrollPlugin.csproj +++ b/Plugins/Reqnroll.Windsor.ReqnrollPlugin/Reqnroll.Windsor.ReqnrollPlugin.csproj @@ -1,6 +1,6 @@ - $(Reqnroll_Runtime_TFM) + netstandard2.0 $(Reqnroll_KeyFile) $(Reqnroll_EnableStrongNameSigning) $(Reqnroll_PublicSign) diff --git a/Plugins/Reqnroll.Windsor.ReqnrollPlugin/Reqnroll.Windsor.nuspec b/Plugins/Reqnroll.Windsor.ReqnrollPlugin/Reqnroll.Windsor.nuspec index feb4de67a..bc9501d40 100644 --- a/Plugins/Reqnroll.Windsor.ReqnrollPlugin/Reqnroll.Windsor.nuspec +++ b/Plugins/Reqnroll.Windsor.ReqnrollPlugin/Reqnroll.Windsor.nuspec @@ -16,28 +16,17 @@ LICENSE reqnroll castle windsor di dependency injection - - - - - - - - - - - - - + + diff --git a/Plugins/Reqnroll.Windsor.ReqnrollPlugin/build/Reqnroll.Windsor.targets b/Plugins/Reqnroll.Windsor.ReqnrollPlugin/build/Reqnroll.Windsor.targets index 47de52b31..3f351247c 100644 --- a/Plugins/Reqnroll.Windsor.ReqnrollPlugin/build/Reqnroll.Windsor.targets +++ b/Plugins/Reqnroll.Windsor.ReqnrollPlugin/build/Reqnroll.Windsor.targets @@ -1,8 +1,6 @@ - - <_Reqnroll_WindsorPluginFramework Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' ">netstandard2.0 - <_Reqnroll_WindsorPluginFramework Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' ">net462 + <_Reqnroll_WindsorPluginFramework>netstandard2.0 <_Reqnroll_WindsorPluginPath>$(MSBuildThisFileDirectory)\..\lib\$(_Reqnroll_WindsorPluginFramework)\Reqnroll.Windsor.ReqnrollPlugin.dll diff --git a/Plugins/Reqnroll.xUnit.Generator.ReqnrollPlugin/Reqnroll.xUnit.Generator.ReqnrollPlugin.csproj b/Plugins/Reqnroll.xUnit.Generator.ReqnrollPlugin/Reqnroll.xUnit.Generator.ReqnrollPlugin.csproj index 66e6500e1..8a0e69ddb 100644 --- a/Plugins/Reqnroll.xUnit.Generator.ReqnrollPlugin/Reqnroll.xUnit.Generator.ReqnrollPlugin.csproj +++ b/Plugins/Reqnroll.xUnit.Generator.ReqnrollPlugin/Reqnroll.xUnit.Generator.ReqnrollPlugin.csproj @@ -1,6 +1,6 @@ - $(Reqnroll_Generator_TFM) + netstandard2.0 $(MSBuildThisFileDirectory)Reqnroll.xUnit.nuspec $(Reqnroll_KeyFile) $(Reqnroll_EnableStrongNameSigning) diff --git a/Plugins/Reqnroll.xUnit.Generator.ReqnrollPlugin/Reqnroll.xUnit.nuspec b/Plugins/Reqnroll.xUnit.Generator.ReqnrollPlugin/Reqnroll.xUnit.nuspec index 421d0d21e..1aa3e7975 100644 --- a/Plugins/Reqnroll.xUnit.Generator.ReqnrollPlugin/Reqnroll.xUnit.nuspec +++ b/Plugins/Reqnroll.xUnit.Generator.ReqnrollPlugin/Reqnroll.xUnit.nuspec @@ -16,39 +16,21 @@ reqnroll xUnit $copyright$ - - - - - - - - - - - - - - - - - + - - - - + + diff --git a/Plugins/Reqnroll.xUnit.Generator.ReqnrollPlugin/build/Reqnroll.xUnit.targets b/Plugins/Reqnroll.xUnit.Generator.ReqnrollPlugin/build/Reqnroll.xUnit.targets index 0a47457ae..60ad81ef6 100644 --- a/Plugins/Reqnroll.xUnit.Generator.ReqnrollPlugin/build/Reqnroll.xUnit.targets +++ b/Plugins/Reqnroll.xUnit.Generator.ReqnrollPlugin/build/Reqnroll.xUnit.targets @@ -16,12 +16,10 @@ - <_Reqnroll_xUnitGeneratorPlugin Condition=" '$(MSBuildRuntimeType)' == 'Core'" >netcoreapp3.1 - <_Reqnroll_xUnitGeneratorPlugin Condition=" '$(MSBuildRuntimeType)' != 'Core'" >net462 + <_Reqnroll_xUnitGeneratorPlugin>netstandard2.0 <_Reqnroll_xUnitGeneratorPluginPath>$(MSBuildThisFileDirectory)\$(_Reqnroll_xUnitGeneratorPlugin)\Reqnroll.xUnit.Generator.ReqnrollPlugin.dll - <_Reqnroll_xUnitRuntimePlugin Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' ">netstandard2.0 - <_Reqnroll_xUnitRuntimePlugin Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' ">net462 + <_Reqnroll_xUnitRuntimePlugin>netstandard2.0 <_Reqnroll_xUnitRuntimePluginPath>$(MSBuildThisFileDirectory)\..\lib\$(_Reqnroll_xUnitRuntimePlugin)\Reqnroll.xUnit.ReqnrollPlugin.dll $(MSBuildThisFileDirectory)xUnit.AssemblyHooks$(DefaultLanguageSourceExtension) diff --git a/Plugins/Reqnroll.xUnit.ReqnrollPlugin/Reqnroll.xUnit.ReqnrollPlugin.csproj b/Plugins/Reqnroll.xUnit.ReqnrollPlugin/Reqnroll.xUnit.ReqnrollPlugin.csproj index 0056c313d..386177533 100644 --- a/Plugins/Reqnroll.xUnit.ReqnrollPlugin/Reqnroll.xUnit.ReqnrollPlugin.csproj +++ b/Plugins/Reqnroll.xUnit.ReqnrollPlugin/Reqnroll.xUnit.ReqnrollPlugin.csproj @@ -1,6 +1,6 @@ - $(Reqnroll_Runtime_TFM) + netstandard2.0 $(Reqnroll_KeyFile) $(Reqnroll_EnableStrongNameSigning) $(Reqnroll_PublicSign) @@ -15,7 +15,9 @@ all runtime; build; native; contentfiles; analyzers + + diff --git a/Reqnroll.Generator/DefaultDependencyProvider.cs b/Reqnroll.Generator/DefaultDependencyProvider.cs index a3bde7d1c..cf9a95e90 100644 --- a/Reqnroll.Generator/DefaultDependencyProvider.cs +++ b/Reqnroll.Generator/DefaultDependencyProvider.cs @@ -6,6 +6,8 @@ using Reqnroll.Generator.Plugins; using Reqnroll.Generator.UnitTestConverter; using Reqnroll.Parser; +using Reqnroll.PlatformCompatibility; +using Reqnroll.Plugins; using Reqnroll.Tracing; using Reqnroll.Utils; @@ -25,6 +27,7 @@ public virtual void RegisterDefaults(ObjectContainer container) container.RegisterTypeAs(); container.RegisterTypeAs(); + PlatformHelper.RegisterPluginAssemblyLoader(container); container.RegisterTypeAs(); container.RegisterTypeAs(); diff --git a/Reqnroll.Generator/Plugins/GeneratorPluginLoader.cs b/Reqnroll.Generator/Plugins/GeneratorPluginLoader.cs index d3018e390..3d2e42994 100644 --- a/Reqnroll.Generator/Plugins/GeneratorPluginLoader.cs +++ b/Reqnroll.Generator/Plugins/GeneratorPluginLoader.cs @@ -1,28 +1,23 @@ using System; -using System.IO; using System.Reflection; using Reqnroll.Infrastructure; +using Reqnroll.PlatformCompatibility; using Reqnroll.Plugins; namespace Reqnroll.Generator.Plugins { - public class GeneratorPluginLoader : IGeneratorPluginLoader + public class GeneratorPluginLoader(IPluginAssemblyLoader _pluginAssemblyLoader) : IGeneratorPluginLoader { public IGeneratorPlugin LoadPlugin(PluginDescriptor pluginDescriptor) { Assembly pluginAssembly; try { - -#if NETCOREAPP - pluginAssembly = PluginAssemblyResolver.Load(pluginDescriptor.Path); -#else - pluginAssembly = Assembly.LoadFrom(pluginDescriptor.Path); -#endif + pluginAssembly = _pluginAssemblyLoader.LoadAssembly(pluginDescriptor.Path); } catch(Exception ex) { - throw new ReqnrollException($"Unable to load plugin assembly: {pluginDescriptor.Path}. Please check https://go.reqnroll.net/doc-plugins for details.", ex); + throw new ReqnrollException($"Unable to load plugin assembly: {pluginDescriptor.Path}. Please check https://go.reqnroll.net/doc-plugins for details. (Framework: {PlatformInformation.DotNetFrameworkDescription})", ex); } var pluginAttribute = (GeneratorPluginAttribute)Attribute.GetCustomAttribute(pluginAssembly, typeof(GeneratorPluginAttribute)); diff --git a/Reqnroll.Generator/Reqnroll.Generator.csproj b/Reqnroll.Generator/Reqnroll.Generator.csproj index 6b17cde00..4938fbb2d 100644 --- a/Reqnroll.Generator/Reqnroll.Generator.csproj +++ b/Reqnroll.Generator/Reqnroll.Generator.csproj @@ -1,6 +1,6 @@ - + - $(Reqnroll_Generator_TFM) + netstandard2.0 Reqnroll.Generator $(Reqnroll_KeyFile) $(Reqnroll_EnableStrongNameSigning) @@ -20,8 +20,6 @@ - - @@ -30,30 +28,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator.Cli/Reqnroll.TestProjectGenerator.Cli.csproj b/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator.Cli/Reqnroll.TestProjectGenerator.Cli.csproj index 280b93c8a..eb2310446 100644 --- a/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator.Cli/Reqnroll.TestProjectGenerator.Cli.csproj +++ b/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator.Cli/Reqnroll.TestProjectGenerator.Cli.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 true reqnroll-tpg diff --git a/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator.Tests/Reqnroll.TestProjectGenerator.Tests.csproj b/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator.Tests/Reqnroll.TestProjectGenerator.Tests.csproj index af180213a..a20db0e0b 100644 --- a/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator.Tests/Reqnroll.TestProjectGenerator.Tests.csproj +++ b/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator.Tests/Reqnroll.TestProjectGenerator.Tests.csproj @@ -1,6 +1,6 @@ - net6.0 + net8.0 false diff --git a/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator.csproj b/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator.csproj index 9b6e8fcaf..66a584098 100644 --- a/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator.csproj +++ b/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator.csproj @@ -21,13 +21,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - diff --git a/Reqnroll.Tools.MsBuild.Generation/Reqnroll.Tools.MsBuild.Generation.csproj b/Reqnroll.Tools.MsBuild.Generation/Reqnroll.Tools.MsBuild.Generation.csproj index 1c06a1bf3..fab42b65a 100644 --- a/Reqnroll.Tools.MsBuild.Generation/Reqnroll.Tools.MsBuild.Generation.csproj +++ b/Reqnroll.Tools.MsBuild.Generation/Reqnroll.Tools.MsBuild.Generation.csproj @@ -1,6 +1,6 @@ - + - $(Reqnroll_Tools_TFM) + $(Reqnroll_FullFramework_Tools_TFM);$(Reqnroll_Core_Tools_TFM) $(Reqnroll_KeyFile) $(Reqnroll_EnableStrongNameSigning) $(Reqnroll_PublicSign) @@ -56,19 +56,6 @@ - - - - - - - - - - - - - Microsoft.Build @@ -91,4 +78,19 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Reqnroll.Tools.MsBuild.Generation/Reqnroll.Tools.MsBuild.Generation.nuspec b/Reqnroll.Tools.MsBuild.Generation/Reqnroll.Tools.MsBuild.Generation.nuspec index 562aabac5..b16bb720d 100644 --- a/Reqnroll.Tools.MsBuild.Generation/Reqnroll.Tools.MsBuild.Generation.nuspec +++ b/Reqnroll.Tools.MsBuild.Generation/Reqnroll.Tools.MsBuild.Generation.nuspec @@ -22,13 +22,13 @@ - - - - - - + + + + diff --git a/Reqnroll.Tools.MsBuild.Generation/build/Reqnroll.Tools.MsBuild.Generation.props b/Reqnroll.Tools.MsBuild.Generation/build/Reqnroll.Tools.MsBuild.Generation.props index b8b91dca9..7569d70ad 100644 --- a/Reqnroll.Tools.MsBuild.Generation/build/Reqnroll.Tools.MsBuild.Generation.props +++ b/Reqnroll.Tools.MsBuild.Generation/build/Reqnroll.Tools.MsBuild.Generation.props @@ -67,7 +67,7 @@ - <_Reqnroll_TaskFolder Condition=" '$(MSBuildRuntimeType)' == 'Core' And '$(_Reqnroll_TaskFolder)' == ''">netcoreapp3.1 + <_Reqnroll_TaskFolder Condition=" '$(MSBuildRuntimeType)' == 'Core' And '$(_Reqnroll_TaskFolder)' == ''">netstandard2.0 <_Reqnroll_TaskFolder Condition=" '$(MSBuildRuntimeType)' != 'Core' And '$(_Reqnroll_TaskFolder)' == ''">net462 <_Reqnroll_TaskAssembly Condition=" '$(_Reqnroll_TaskAssembly)' == '' ">..\tasks\$(_Reqnroll_TaskFolder)\Reqnroll.Tools.MsBuild.Generation.dll diff --git a/Reqnroll.sln.DotSettings b/Reqnroll.sln.DotSettings index 00558d182..00beadc2b 100644 --- a/Reqnroll.sln.DotSettings +++ b/Reqnroll.sln.DotSettings @@ -101,4 +101,5 @@ True True True - True \ No newline at end of file + True + True \ No newline at end of file diff --git a/Reqnroll/AssemblyAttributes.cs b/Reqnroll/AssemblyAttributes.cs index 44461642d..b14eb35dd 100644 --- a/Reqnroll/AssemblyAttributes.cs +++ b/Reqnroll/AssemblyAttributes.cs @@ -1,14 +1,5 @@ - using System.Runtime.CompilerServices; -//[assembly: AllowPartiallyTrustedCallers] - -#if REQNROLL_ENABLE_STRONG_NAME_SIGNING [assembly: InternalsVisibleTo("Reqnroll.RuntimeTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010059bb085601a8b65a8a7b00f34e6d85df230f1e4913d3c0eaadcd13c1fd9cd15c3f01567c49d5f41f617dbda6f544ea3e2d5b5a042f307a7c8d21a079254509ba543efaefce96fac977abd0a76206b721abc33f84ee45ae5383cf50eeb8e234595656fd4af916e1dcde644ce20bb9a68bd72bc7957b759560524c63ca294585ca")] [assembly: InternalsVisibleTo("Reqnroll.PluginTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010059bb085601a8b65a8a7b00f34e6d85df230f1e4913d3c0eaadcd13c1fd9cd15c3f01567c49d5f41f617dbda6f544ea3e2d5b5a042f307a7c8d21a079254509ba543efaefce96fac977abd0a76206b721abc33f84ee45ae5383cf50eeb8e234595656fd4af916e1dcde644ce20bb9a68bd72bc7957b759560524c63ca294585ca")] [assembly: InternalsVisibleTo("Reqnroll.SpecFlowCompatibility.ReqnrollPlugin, PublicKey=002400000480000094000000060200000024000052534131000400000100010059bb085601a8b65a8a7b00f34e6d85df230f1e4913d3c0eaadcd13c1fd9cd15c3f01567c49d5f41f617dbda6f544ea3e2d5b5a042f307a7c8d21a079254509ba543efaefce96fac977abd0a76206b721abc33f84ee45ae5383cf50eeb8e234595656fd4af916e1dcde644ce20bb9a68bd72bc7957b759560524c63ca294585ca")] -#else -[assembly: InternalsVisibleTo("Reqnroll.RuntimeTests")] -[assembly: InternalsVisibleTo("Reqnroll.PluginTests")] -[assembly: InternalsVisibleTo("Reqnroll.SpecFlowCompatibility.ReqnrollPlugin")] -#endif diff --git a/Reqnroll/Bindings/BindingInvoker.cs b/Reqnroll/Bindings/BindingInvoker.cs index 0fa34aba6..82273cabc 100644 --- a/Reqnroll/Bindings/BindingInvoker.cs +++ b/Reqnroll/Bindings/BindingInvoker.cs @@ -9,7 +9,6 @@ using System.Threading; using System.Threading.Tasks; using Reqnroll.Bindings.Reflection; -using Reqnroll.Compatibility; using Reqnroll.Configuration; using Reqnroll.ErrorHandling; using Reqnroll.Infrastructure; @@ -168,11 +167,7 @@ protected virtual Delegate CreateMethodDelegate(MethodInfo method) parameters.ToArray()); } -#if WINDOWS_PHONE - return ExpressionCompiler.ExpressionCompiler.Compile(lambda); -#else return lambda.Compile(); -#endif } protected virtual Expression GetBindingMethodCallExpression(Expression instance, MethodInfo method, Expression[] argumentsExpressions) diff --git a/Reqnroll/Bindings/Discovery/BindingSourceProcessor.cs b/Reqnroll/Bindings/Discovery/BindingSourceProcessor.cs index d6c88d9ac..147acb129 100644 --- a/Reqnroll/Bindings/Discovery/BindingSourceProcessor.cs +++ b/Reqnroll/Bindings/Discovery/BindingSourceProcessor.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; using Reqnroll.Bindings.Reflection; -using Reqnroll.Compatibility; +using Reqnroll.PlatformCompatibility; namespace Reqnroll.Bindings.Discovery { diff --git a/Reqnroll/Bindings/Discovery/RuntimeBindingRegistryBuilder.cs b/Reqnroll/Bindings/Discovery/RuntimeBindingRegistryBuilder.cs index 63f239e0c..a1f475816 100644 --- a/Reqnroll/Bindings/Discovery/RuntimeBindingRegistryBuilder.cs +++ b/Reqnroll/Bindings/Discovery/RuntimeBindingRegistryBuilder.cs @@ -4,9 +4,9 @@ using System.Reflection; using Reqnroll.BoDi; using Reqnroll.Bindings.Reflection; -using Reqnroll.Compatibility; using Reqnroll.Configuration; using Reqnroll.Infrastructure; +using Reqnroll.PlatformCompatibility; namespace Reqnroll.Bindings.Discovery { diff --git a/Reqnroll/Bindings/StepContext.cs b/Reqnroll/Bindings/StepContext.cs index 7418becd0..c18425f12 100644 --- a/Reqnroll/Bindings/StepContext.cs +++ b/Reqnroll/Bindings/StepContext.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using System.Globalization; -using Reqnroll.Compatibility; using Reqnroll.Configuration; +using Reqnroll.PlatformCompatibility; namespace Reqnroll.Bindings { diff --git a/Reqnroll/Configuration/ConfigurationLoader.cs b/Reqnroll/Configuration/ConfigurationLoader.cs index 1bd1f9dd4..469018523 100644 --- a/Reqnroll/Configuration/ConfigurationLoader.cs +++ b/Reqnroll/Configuration/ConfigurationLoader.cs @@ -4,8 +4,8 @@ using System.IO; using Reqnroll.BoDi; using Reqnroll.BindingSkeletons; -using Reqnroll.Compatibility; using Reqnroll.Configuration.JsonConfig; +using Reqnroll.PlatformCompatibility; using Reqnroll.Tracing; namespace Reqnroll.Configuration diff --git a/Reqnroll/Infrastructure/DefaultDependencyProvider.cs b/Reqnroll/Infrastructure/DefaultDependencyProvider.cs index 54b48f8bc..fc05fa24a 100644 --- a/Reqnroll/Infrastructure/DefaultDependencyProvider.cs +++ b/Reqnroll/Infrastructure/DefaultDependencyProvider.cs @@ -15,6 +15,7 @@ using Reqnroll.TestFramework; using Reqnroll.Time; using Reqnroll.Tracing; +using Reqnroll.PlatformCompatibility; namespace Reqnroll.Infrastructure { @@ -56,6 +57,7 @@ public virtual void RegisterGlobalContainerDefaults(ObjectContainer container) container.RegisterTypeAs(); container.RegisterTypeAs(); + PlatformHelper.RegisterPluginAssemblyLoader(container); container.RegisterTypeAs(); container.RegisterTypeAs(); container.RegisterTypeAs(); diff --git a/Reqnroll/Infrastructure/TestExecutionEngine.cs b/Reqnroll/Infrastructure/TestExecutionEngine.cs index e36fe9649..c0af86828 100644 --- a/Reqnroll/Infrastructure/TestExecutionEngine.cs +++ b/Reqnroll/Infrastructure/TestExecutionEngine.cs @@ -7,10 +7,10 @@ using Reqnroll.Analytics; using Reqnroll.Bindings; using Reqnroll.Bindings.Reflection; -using Reqnroll.Compatibility; using Reqnroll.Configuration; using Reqnroll.ErrorHandling; using Reqnroll.Events; +using Reqnroll.PlatformCompatibility; using Reqnroll.Plugins; using Reqnroll.Tracing; using Reqnroll.UnitTestProvider; diff --git a/Reqnroll/PlatformCompatibility/CultureInfoHelper.cs b/Reqnroll/PlatformCompatibility/CultureInfoHelper.cs index 9effe95b9..6c674a165 100644 --- a/Reqnroll/PlatformCompatibility/CultureInfoHelper.cs +++ b/Reqnroll/PlatformCompatibility/CultureInfoHelper.cs @@ -1,6 +1,6 @@ using System.Globalization; -namespace Reqnroll.Compatibility +namespace Reqnroll.PlatformCompatibility { internal static class CultureInfoHelper { diff --git a/Reqnroll/PlatformCompatibility/EnumHelper.cs b/Reqnroll/PlatformCompatibility/EnumHelper.cs index 43d9b34d6..4d0efcff3 100644 --- a/Reqnroll/PlatformCompatibility/EnumHelper.cs +++ b/Reqnroll/PlatformCompatibility/EnumHelper.cs @@ -1,6 +1,6 @@ using System; -namespace Reqnroll.Compatibility +namespace Reqnroll.PlatformCompatibility { internal static class EnumHelper { diff --git a/Reqnroll/PlatformCompatibility/ExceptionHelper.cs b/Reqnroll/PlatformCompatibility/ExceptionHelper.cs index 6ae159750..5dc90c12a 100644 --- a/Reqnroll/PlatformCompatibility/ExceptionHelper.cs +++ b/Reqnroll/PlatformCompatibility/ExceptionHelper.cs @@ -1,7 +1,7 @@ using System; using System.Reflection; -namespace Reqnroll.Compatibility +namespace Reqnroll.PlatformCompatibility { internal static class ExceptionHelper { diff --git a/Reqnroll/PlatformCompatibility/MonoHelper.cs b/Reqnroll/PlatformCompatibility/MonoHelper.cs index 08025054f..30d47b355 100644 --- a/Reqnroll/PlatformCompatibility/MonoHelper.cs +++ b/Reqnroll/PlatformCompatibility/MonoHelper.cs @@ -1,7 +1,7 @@ using System; using System.Reflection; -namespace Reqnroll.Compatibility +namespace Reqnroll.PlatformCompatibility { internal class MonoHelper { diff --git a/Reqnroll/PlatformCompatibility/PlatformHelper.cs b/Reqnroll/PlatformCompatibility/PlatformHelper.cs new file mode 100644 index 000000000..ca573b5ce --- /dev/null +++ b/Reqnroll/PlatformCompatibility/PlatformHelper.cs @@ -0,0 +1,14 @@ +using Reqnroll.BoDi; +using Reqnroll.Plugins; + +namespace Reqnroll.PlatformCompatibility; +public static class PlatformHelper +{ + public static void RegisterPluginAssemblyLoader(IObjectContainer container) + { + if (PlatformInformation.IsDotNetFramework) + container.RegisterTypeAs(); + else + container.RegisterTypeAs(); + } +} diff --git a/Reqnroll/PlatformCompatibility/PlatformInformation.cs b/Reqnroll/PlatformCompatibility/PlatformInformation.cs new file mode 100644 index 000000000..eb0eaad0c --- /dev/null +++ b/Reqnroll/PlatformCompatibility/PlatformInformation.cs @@ -0,0 +1,26 @@ +using System.Diagnostics; +using System.Runtime.InteropServices; +using System; +using System.Text.RegularExpressions; + +namespace Reqnroll.PlatformCompatibility; +public class PlatformInformation +{ + public static Architecture ProcessArchitecture => RuntimeInformation.ProcessArchitecture; + public static string DotNetFullVersion { get; } = FileVersionInfo.GetVersionInfo(typeof(Uri).Assembly.Location).ProductVersion; + public static string DotNetFrameworkDescription => RuntimeInformation.FrameworkDescription; + public static string DotNetFrameworkMainDescription { get; } = GetMainDotNetFrameworkDescription(); + public static bool IsDotNetFramework { get; } = GetIsDotNetFramework(); + + private static bool GetIsDotNetFramework() + { + string frameworkDescription = DotNetFrameworkDescription; + return frameworkDescription.StartsWith(".NET Framework", StringComparison.OrdinalIgnoreCase) || + frameworkDescription.StartsWith("Mono", StringComparison.OrdinalIgnoreCase); + } + + private static string GetMainDotNetFrameworkDescription() + { + return Regex.Replace(RuntimeInformation.FrameworkDescription, @"(?\d+\.\d+).*", "${mver}"); + } +} diff --git a/Reqnroll/Plugins/DotNetFrameworkPluginAssemblyLoader.cs b/Reqnroll/Plugins/DotNetFrameworkPluginAssemblyLoader.cs new file mode 100644 index 000000000..7ee805f63 --- /dev/null +++ b/Reqnroll/Plugins/DotNetFrameworkPluginAssemblyLoader.cs @@ -0,0 +1,8 @@ +using System.Reflection; + +namespace Reqnroll.Plugins; + +public class DotNetFrameworkPluginAssemblyLoader : IPluginAssemblyLoader +{ + public Assembly LoadAssembly(string assemblyName) => Assembly.LoadFrom(assemblyName); +} diff --git a/Reqnroll/Plugins/IPluginAssemblyLoader.cs b/Reqnroll/Plugins/IPluginAssemblyLoader.cs new file mode 100644 index 000000000..7d46da021 --- /dev/null +++ b/Reqnroll/Plugins/IPluginAssemblyLoader.cs @@ -0,0 +1,7 @@ +using System.Reflection; + +namespace Reqnroll.Plugins; +public interface IPluginAssemblyLoader +{ + Assembly LoadAssembly(string assemblyName); +} \ No newline at end of file diff --git a/Reqnroll/Plugins/PluginAssemblyLoader.cs b/Reqnroll/Plugins/PluginAssemblyLoader.cs new file mode 100644 index 000000000..9129d406f --- /dev/null +++ b/Reqnroll/Plugins/PluginAssemblyLoader.cs @@ -0,0 +1,8 @@ +using System.Reflection; + +namespace Reqnroll.Plugins; + +public class PluginAssemblyLoader : IPluginAssemblyLoader +{ + public Assembly LoadAssembly(string assemblyName) => PluginAssemblyResolver.Load(assemblyName); +} diff --git a/Reqnroll/Plugins/PluginAssemblyResolver.cs b/Reqnroll/Plugins/PluginAssemblyResolver.cs index 294ea8f4f..b7ef4817f 100644 --- a/Reqnroll/Plugins/PluginAssemblyResolver.cs +++ b/Reqnroll/Plugins/PluginAssemblyResolver.cs @@ -1,5 +1,3 @@ -#if NETSTANDARD - using System; using System.Collections.Generic; using System.IO; @@ -77,5 +75,3 @@ public static Assembly Load(string path) } } } - -#endif \ No newline at end of file diff --git a/Reqnroll/Plugins/RuntimePluginLoader.cs b/Reqnroll/Plugins/RuntimePluginLoader.cs index e0e4b187f..1d61da1f0 100644 --- a/Reqnroll/Plugins/RuntimePluginLoader.cs +++ b/Reqnroll/Plugins/RuntimePluginLoader.cs @@ -1,25 +1,22 @@ using System; using System.Reflection; +using Reqnroll.PlatformCompatibility; using Reqnroll.Tracing; namespace Reqnroll.Plugins { - public class RuntimePluginLoader : IRuntimePluginLoader + public class RuntimePluginLoader(IPluginAssemblyLoader _pluginAssemblyLoader) : IRuntimePluginLoader { public IRuntimePlugin LoadPlugin(string pluginAssemblyName, ITraceListener traceListener, bool traceMissingPluginAttribute) { Assembly assembly; try { -#if NETSTANDARD - assembly = PluginAssemblyResolver.Load(pluginAssemblyName); -#else - assembly = Assembly.LoadFrom(pluginAssemblyName); -#endif + assembly = _pluginAssemblyLoader.LoadAssembly(pluginAssemblyName); } catch (Exception ex) { - throw new ReqnrollException($"Unable to load plugin: {pluginAssemblyName}. Please check https://go.reqnroll.net/doc-plugins for details.", ex); + throw new ReqnrollException($"Unable to load plugin: {pluginAssemblyName}. Please check https://go.reqnroll.net/doc-plugins for details. (Framework: {PlatformInformation.DotNetFrameworkDescription})", ex); } var pluginAttribute = (RuntimePluginAttribute)Attribute.GetCustomAttribute(assembly, typeof(RuntimePluginAttribute)); diff --git a/Reqnroll/Plugins/RuntimePluginLocationMerger.cs b/Reqnroll/Plugins/RuntimePluginLocationMerger.cs index 6056e0ab2..6057a3e7e 100644 --- a/Reqnroll/Plugins/RuntimePluginLocationMerger.cs +++ b/Reqnroll/Plugins/RuntimePluginLocationMerger.cs @@ -8,12 +8,7 @@ public class RuntimePluginLocationMerger : IRuntimePluginLocationMerger public IReadOnlyList Merge(IReadOnlyList pluginPaths) { // Idea is to filter out the same assemblies stored on different paths. Shortcut: check if we even have duplicated assemblies - var hashset = new HashSet( -#if NETCOREAPP2_1_OR_GREATER - // initialize with expected size when available - pluginPaths.Count -#endif - ); + var hashset = new HashSet(); List modifiedList = null; for (var i = 0; i < pluginPaths.Count; i++) diff --git a/Reqnroll/Reqnroll.csproj b/Reqnroll/Reqnroll.csproj index 473f67ce8..023f1c76d 100644 --- a/Reqnroll/Reqnroll.csproj +++ b/Reqnroll/Reqnroll.csproj @@ -1,6 +1,6 @@  - $(Reqnroll_Runtime_TFM) + netstandard2.0 Reqnroll $(Reqnroll_KeyFile) $(Reqnroll_EnableStrongNameSigning) @@ -18,12 +18,13 @@ true + all runtime; build; native; contentfiles; analyzers - + @@ -31,29 +32,13 @@ - - - - - - - - - - - - - + - - $(DefineConstants);NETSTANDARD - - 3fd018ff-819d-4685-a6e1-6f09bc98d20b diff --git a/Reqnroll/Reqnroll.nuspec b/Reqnroll/Reqnroll.nuspec index 75c6b93ff..fd0d550d4 100644 --- a/Reqnroll/Reqnroll.nuspec +++ b/Reqnroll/Reqnroll.nuspec @@ -16,19 +16,12 @@ reqnroll bdd gherkin cucumber $copyright$ - + - - - - - - - @@ -37,14 +30,11 @@ - - - - - - - - + + + + + diff --git a/Reqnroll/Table.cs b/Reqnroll/Table.cs index 3584cf680..826f65d7f 100644 --- a/Reqnroll/Table.cs +++ b/Reqnroll/Table.cs @@ -10,9 +10,7 @@ namespace Reqnroll /// /// An alias for the class for backwards compatibility. /// -#if !BODI_LIMITEDRUNTIME [Serializable] -#endif public class Table { internal const string ERROR_NO_CELLS_TO_ADD = "No cells to add"; @@ -175,9 +173,7 @@ private void AddTableRow(StringBuilder builder, IEnumerable cells, int[] } } -#if !BODI_LIMITEDRUNTIME [Serializable] -#endif public class DataTableRows : IEnumerable { private readonly List _innerList = new(); @@ -207,9 +203,7 @@ internal string[][] ToArray() } } -#if !BODI_LIMITEDRUNTIME [Serializable] -#endif public class DataTableRow : IDictionary { private readonly Table _table; diff --git a/Reqnroll/Tracing/AnsiColor/AnsiColor.cs b/Reqnroll/Tracing/AnsiColor/AnsiColor.cs index c92487a24..e33e81746 100644 --- a/Reqnroll/Tracing/AnsiColor/AnsiColor.cs +++ b/Reqnroll/Tracing/AnsiColor/AnsiColor.cs @@ -23,9 +23,6 @@ public readonly struct AnsiColor public static AnsiColor Background(int r, int g, int b) => new(TerminalControlSequences.SetBackgroundColor, new TerminalRgbColor(r, g, b)); public static AnsiColor Composite(params AnsiColor[] codes) => new(codes); -#if NET3_0_OR_GREATER - [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("text")] -#endif public static string? ColorizeText(string? text, AnsiColor code) { if (text == null) return null; @@ -70,7 +67,7 @@ public AnsiColor(TerminalControlSequences controlSequence, TerminalRgbColor rgbC private TerminalControlSequences GetResetSequence(TerminalControlSequences controlSequence) { - switch (ControlSequence) + switch (controlSequence) { case TerminalControlSequences.SetForegroundColor: return TerminalControlSequences.DefaultForegroundColor; case TerminalControlSequences.SetBackgroundColor: return TerminalControlSequences.DefaultBackgroundColor; diff --git a/Reqnroll/Tracing/LanguageHelper.cs b/Reqnroll/Tracing/LanguageHelper.cs index c22c5ab0a..dd9b0498f 100644 --- a/Reqnroll/Tracing/LanguageHelper.cs +++ b/Reqnroll/Tracing/LanguageHelper.cs @@ -4,9 +4,8 @@ using System.Linq; using Gherkin; using Reqnroll.Bindings; -using Reqnroll.Compatibility; using Reqnroll.Parser; - +using Reqnroll.PlatformCompatibility; namespace Reqnroll.Tracing { diff --git a/Tests/Reqnroll.GeneratorTests/Reqnroll.GeneratorTests.csproj b/Tests/Reqnroll.GeneratorTests/Reqnroll.GeneratorTests.csproj index 919c7e9be..e89529de3 100644 --- a/Tests/Reqnroll.GeneratorTests/Reqnroll.GeneratorTests.csproj +++ b/Tests/Reqnroll.GeneratorTests/Reqnroll.GeneratorTests.csproj @@ -40,20 +40,7 @@ all runtime; build; native; contentfiles; analyzers - - - - - - - - - - - - - diff --git a/Tests/Reqnroll.PluginTests/Generator/GeneratorPluginLoaderTests.cs b/Tests/Reqnroll.PluginTests/Generator/GeneratorPluginLoaderTests.cs index 4a57cb101..2c65090a2 100644 --- a/Tests/Reqnroll.PluginTests/Generator/GeneratorPluginLoaderTests.cs +++ b/Tests/Reqnroll.PluginTests/Generator/GeneratorPluginLoaderTests.cs @@ -1,6 +1,3 @@ -using System; -using System.IO; -using System.Reflection; using FluentAssertions; using Reqnroll.Generator.Plugins; using Reqnroll.Plugins; @@ -15,7 +12,7 @@ public class GeneratorPluginLoaderTests public void LoadPlugin_LoadXUnitSuccessfully() { //ARRANGE - var generatorPluginLoader = new GeneratorPluginLoader(); + var generatorPluginLoader = new GeneratorPluginLoader(new PluginAssemblyLoader()); //ACT var pluginDescriptor = new PluginDescriptor("Reqnroll.xUnit.Generator.ReqnrollPlugin", "Reqnroll.xUnit.Generator.ReqnrollPlugin.dll", PluginType.Generator, ""); diff --git a/Tests/Reqnroll.PluginTests/Infrastructure/WindsorPluginTests.cs b/Tests/Reqnroll.PluginTests/Infrastructure/WindsorPluginTests.cs index f6b0140df..3910edf0a 100644 --- a/Tests/Reqnroll.PluginTests/Infrastructure/WindsorPluginTests.cs +++ b/Tests/Reqnroll.PluginTests/Infrastructure/WindsorPluginTests.cs @@ -21,7 +21,7 @@ public class WindsorPluginTests [Fact] public void Can_load_Windsor_plugin() { - var loader = new RuntimePluginLoader(); + var loader = new RuntimePluginLoader(new PluginAssemblyLoader()); var listener = new Mock(); var plugin = loader.LoadPlugin("Reqnroll.Windsor.ReqnrollPlugin.dll", listener.Object, It.IsAny()); diff --git a/Tests/Reqnroll.RuntimeTests/Reqnroll.RuntimeTests.csproj b/Tests/Reqnroll.RuntimeTests/Reqnroll.RuntimeTests.csproj index de56b850a..f1ac8b1ef 100644 --- a/Tests/Reqnroll.RuntimeTests/Reqnroll.RuntimeTests.csproj +++ b/Tests/Reqnroll.RuntimeTests/Reqnroll.RuntimeTests.csproj @@ -34,21 +34,9 @@ all runtime; build; native; contentfiles; analyzers - - - - - - - - - - - - diff --git a/Tests/Reqnroll.Specs/Reqnroll.Specs.csproj b/Tests/Reqnroll.Specs/Reqnroll.Specs.csproj index c9201c45b..0298e7856 100644 --- a/Tests/Reqnroll.Specs/Reqnroll.Specs.csproj +++ b/Tests/Reqnroll.Specs/Reqnroll.Specs.csproj @@ -1,4 +1,4 @@ - + @@ -57,8 +57,8 @@ - <_Reqnroll_Needed_MSBuildGenerator Condition=" '$(MSBuildRuntimeType)' == 'Core'">net6.0 - <_Reqnroll_Needed_MSBuildGenerator Condition=" '$(MSBuildRuntimeType)' != 'Core'">$(Reqnroll_FullFramework_Generator_TFM) + <_Reqnroll_Needed_MSBuildGenerator Condition=" '$(MSBuildRuntimeType)' == 'Core'">$(Reqnroll_Core_Tools_TFM) + <_Reqnroll_Needed_MSBuildGenerator Condition=" '$(MSBuildRuntimeType)' != 'Core'">$(Reqnroll_FullFramework_Tools_TFM) @@ -73,15 +73,15 @@ - + - + - <_Reqnroll_TaskAssembly>..\..\Reqnroll.Tools.MsBuild.Generation\bin\$(Configuration)\$(_Reqnroll_Needed_MSBuildGenerator)\Reqnroll.Tools.MsBuild.Generation.dll + <_Reqnroll_TaskAssembly>..\..\Reqnroll.Tools.MsBuild.Generation\bin\$(Configuration)\$(_Reqnroll_Needed_MSBuildGenerator)\tasks\Reqnroll.Tools.MsBuild.Generation.dll diff --git a/docs/extend/plugins.md b/docs/extend/plugins.md index e72c66646..fe6f7a437 100644 --- a/docs/extend/plugins.md +++ b/docs/extend/plugins.md @@ -9,7 +9,9 @@ All types of plugins are created in a similar way. ## Runtime plugins -Runtime plugins need to target .NET Framework 4.6.2 and .NET Standard 2.0. +Runtime plugins should target .NET Standard 2.0 to be compatible with all .NET versions supported +by Reqnroll. Targetting a more specific version will limit the compatibility of your plugin. + Reqnroll searches for files that end with `.ReqnrollPlugin.dll` in the following locations: * The folder containing your `Reqnroll.dll` file @@ -44,7 +46,15 @@ Mandatory: ## Generator plugins -Generator plugins need to target .NET Framework 4.7.1 and .NET Core 3.1. +Runtime plugins should target .NET Standard 2.0 to be compatible with all scenarios supported by +Reqnroll. + +The generator plugins are invoked during build. They are usually invoked in a .NET environment +according to your .NET SDK (e.g. .NET 8.0), but in some cases (when built using MSBuild or in Visual Studio) +they might be invoked in a .NET 4.8 environment. Therefore, you have to make sure that your plugin +works in both environments. If necessary, you can multi-target your plugin, but using the right compiled +version of your plugin is the responsibility of the plugin itself. + The MSBuild task needs to know which generator plugins it should use. You therefore have to add your generator plugin to the `ReqnrollGeneratorPlugins` ItemGroup. This is passed to the MSBuild task as a parameter and later used to load the plugins. @@ -65,28 +75,31 @@ This is passed to the MSBuild task as a parameter and later used to load the plu ## Combined Package with both plugins -If you need to update generator and runtime plugins with a single NuGet package (as we are doing with the `Reqnroll.xUnit`, `Reqnroll.NUnit` and `Reqnroll.xUnit` packages), you can do so. +You can have a single NuGet package that contains both the runtime and generator plugins. +We use this approach for the `Reqnroll.xUnit`, `Reqnroll.NUnit` and `Reqnroll.xUnit` packages +for example. -As with the separate plugins, you need two projects. One for the runtime plugin, and one for the generator plugin. As you only want one NuGet package, the **NuSpec files must only be present in the generator project**. -This is because the generator plugin is built with a higher .NET Framework version (.NET 4.7.1), meaning you can add a dependency on the Runtime plugin (which is only .NET 4.6.1). This will not working the other way around. +The combined package can be built from a single project, or from two projects. The latter +allows you to have different dependencies for the runtime and generator plugins. -You can simply combine the contents of the `.targets` and `.props` file to a single one. +If you use two projects for the combined package, the **NuSpec files should only be present +in the generator project**. This is because the generators typically have more dependencies. +You can simply combine the contents of the `.targets` and `.props` file to a single one. ## Tips & Tricks ### Building Plugins on non-Windows machines -For building .NET 4.6.2 projects on non- Windows machines, the .NET Framework reference assemblies are needed. +For building .NET 4.6.2 projects on non-Windows machines, the .NET Framework reference assemblies are needed. You can add them with following PackageReference to your project: -``` xml +```xml all runtime; build; native; contentfiles; analyzers - ```