5

Following situation:

I have a third party tool which executes the nunit-console.exe to run unit tests. I've switched the tests to dot net 5.0 as this is a new requirement in our company. Now when I run the nunit-console.exe (Version: NUnit Console Runner 3.12.0-beta2) in the console the same way the third party app does I get this error:

>E:\Nunit\netcoreapp3.1\nunit3-console.exe "C:\Tests\bin\Debug\net5.0\Tests.dll"
it was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '3.1.0' was not found.
  - The following frameworks were found:
      5.0.3 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      5.0.4 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      5.0.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      5.0.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

So a possible solution to fix this would be running the console like this:

dotnet.exe --fx-version 5.0.7 E:\Nunit\netcoreapp3.1\nunit3-console.dll "C:\Tests\bin\Debug\net5.0\V20.Tests.dll"

Which works perfectly in the console but is not compliant to the third party app as it needs the nunit-console.exe to execute

Does anybody have a creative idea how to solve this in an rater easy manner?

somecoolname
  • 337
  • 5
  • 16
  • what if you install a .net core 3.1.0? – Lei Yang Jul 08 '21 at 06:49
  • 1
    there's a similiar open issue in github [NUnit Console cannot run tests with TargetFramework "net5.0"](https://github.com/nunit/nunit-console/issues/858) – Lei Yang Jul 08 '21 at 06:57
  • If I install .net core 3.1.0 I get errors from the test solution: Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. I already studied this article: NUnit Console cannot run tests with TargetFramework "net5.0" from there I have the tip to run it with --fx-version shich works in console but I need to run it with nunit-console.exe – somecoolname Jul 08 '21 at 07:16

0 Answers0