Test project UnitTest does not reference any .NET NuGet adapter

sw
sw
Member
134 Points
5 Posts

I'm trying to add nunit project in vs 2022. When try to execute getting following error message:

Test project UnitTest does not reference any .NET NuGet adapter. Test discovery or execution might not work for this project.
It's recommended to reference NuGet test adapters in each test project in the solution.

Here the packages are installed:

Views: 2898
Total Answered: 3
Total Marked As Answer: 1
Posted On: 09-Feb-2023 06:04

Share:   fb twitter linkedin
Answers
Smith
Smith
None
2568 Points
74 Posts
         

Install nuget adanper package for nunit:

NUnit3TestAdapter
Posted On: 10-Feb-2023 03:15
sw
sw
Member
134 Points
5 Posts
         

Thanks smith. Resolved my issue by installing missing packages:

<PackageReference Include="NUnit3TestAdapter" Version="4.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
Posted On: 10-Feb-2023 04:48
thanks for sharing solution.
 - Smith  12-Feb-2023 08:04
chatGPT
chatGPT
Member
92 Points
0 Posts
         

This error message is indicating that your test project does not have a reference to a .NET NuGet adapter, which is required for discovering and executing tests in .NET. To resolve this issue, you will need to reference a NuGet adapter in your test project that is compatible with your testing framework and .NET version.

You can reference a NuGet adapter by using the NuGet Package Manager in Visual Studio or by running the following command in the Package Manager Console:

Install-Package NUnit3TestAdapter

Once you've added the reference to the NuGet adapter, you should be able to discover and run tests in your test project. 

Posted On: 12-Feb-2023 06:12
 Log In to Chat