Unsupported test framework error in NUnit

半城伤御伤魂 提交于 2019-11-29 09:19:52
Chris

It looks like you are trying to run NUnit3 tests with the NUnit2 Test Adapter. This is not supported.

You need to install the NUnit3 Test Adapter through Tools > Extensions and Updates in Visual Studio.

NUnit 3.x.y (NUnit 3.4.1) is compatible with NUnit3TestAdapter 3.x.y (NUnit3TestAdapter 3.4.0) NUnit 2.x.y (NUnit 2.6.4) is compatible with NUnitTestAdapter 2.x.y (NUnitTestAdapter 2.0.0)

If you use NUnit 3.x.y you have to install NUnit3TestAdapter 3.x.y instead of NUnitTestAdapter 2.x.y

I am using Microsoft Visual Studio Community 2015 and Microsoft .NET Framework 4.x

Steps to follow for installation:
1. Open Visual Studio and create a project
2. Right click on project -> Click on "Manage Nuget Packages..." from context menu
3. From pop up window: Install NUnit 3.x.y and NUnit3TestAdapter 3.x.y
4. Now run your tests

NUnit 3 only runs with NUnit test adapter 3 or latest version since there is compatibility issue with the older version 2.0. so if you have an exception like this:NUnit VS Adapter 2.0.0.0 discovering tests is started Attempt to load assembly with unsupported test framework in c:....... NUnit VS Adapter 2.0.0.0 discovering test is finished then all you need to do is to install the latest version of NUnit and NUnit test adapter on to your project be right clicking referencence on your solution explorer and manage Nuget packages.

run Install-Package NUnit3TestAdapter -Version 3.10.0 on your Package Manager Console.

Run this package manange console.

PM> Install-Package NUnit3TestAdapter -Version 3.10.0

Make sure that, you have selected the nuget.org in package source dropdown and selected the Test project in Default project dropdown.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!