0

I am in the process of migrating projects from .NET Framework to .NET Core. We have several hundred of them with lots of unit tests that are executed by the NUnit console runner. Recently, we discovered that the .NET Framework version of the NUnit console runner tries to execute the .NET Core tests as well and fails at this task. The test .dlls are built to the same output folder for DevOps purposes.

As a workaround we started to specifically exclude the projects that we already migrated to .NET Core and run them separately with dotnet test.

This is fine with a couple of projects but it is going to get very messy very soon so I am looking for a way to solve this. I know there is a way to exclude certain categories and we could mark the TestFixtures in the migrated projects with some category but I would like to know if there is a better way around this.

Is it possible to Configure NUnit test runner to check for the target framework and exclude .NET Core projects?

2
  • 1
    FWIW, most folks have no problem running a mix of .NET Framework and .NET Core tests using NUnit. But to get an answer, you need to be more specific.By "NUnit test runner", you might mean a number of different things, like nunit-console.exe, nunit vs test adapter, nunitlite runner, etc. Also, please say what version of whatever it is you are running. Commented Feb 21, 2023 at 19:49
  • 2
    I'd like to put it the other way around: what about running all your tests (both .NET Framework and "Core") via dotnet test? Commented Feb 23, 2023 at 12:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.