Does NUnit work under Visual Studio 2022? All of the setup instructions I can find relate to previous versions of Visual Studio and reference things that are not present (such as "Tools -> Manage Extensions menu in Visual Studio. Click on Online and enter the search term as NUnit Test Adapter" - the search yields no results). If it does work, how do I set it up?
3 Answers
You can add both NUnit Framework and NUnit Test Adapter using NuGet Packages.
To do that, right click on your project in Solution Explorer, go to Manage NuGet packages..., in the Browse section type nunit, install NUnit package and the corresponding version adapter (NUnitTestAdapter for NUnit 2.x or NUnit3TestAdapter for NUnit 3.x).

- 408
- 5
- 7
-
5It is also necessary to add the test adapter to every test project in the solution. This caught me out when migrating a project that had been created in an older version of Visual Studio where it only used to be necessary to add the adapter to the solution once. – Code Ranger Feb 01 '22 at 20:26
-
For more details also see the [documentation](https://docs.nunit.org/articles/vs-test-adapter/Index.html). – CodeFox Apr 29 '22 at 17:44
-
Test adapter transitivity issue seems to only occur on VS 2022 for Mac as of at least 17.2 as had another project reference that added the NUnit adapter dependency and this worked fine on Windows but Mac could not find the tests – GameSalutes Aug 30 '22 at 21:28
-
Then open up Test Explorer to view the tests – Matthew Lock Feb 06 '23 at 07:36
FWIW, I installed both the NUnit Framework and NUnit Test Adapter packages and my tests were still being ignored. I had to install the Microsoft.NET.Test.Sdk package as well. I always seem to forget about this one.

- 785
- 2
- 11
- 30
I had installed the NUnit3TestAdapter through NuGet, but recently my tests had stopped working and I couldn't figure out why. It took me a long time to realize that all I needed to do was update my NuGet packages.
I was using NUnit3TestAdapter 4.2.1, and after updating to NUnit3TestAdapter 4.4.2 my tests started working again.

- 3,178
- 17
- 43
-
Fixed mine too, but my versions were wider apart than yours. – Jonathan Johansen Jun 15 '23 at 06:06