Unsupported test framework error in NUnit
Asked Answered
L

5

18

I am using NUnit testing with Visual Studio 2013. We are using NUnitTestAdapter for integration of test run of NUnit with Visual Studio.

Visual Studio 2013 NUnit is version="3.0.1" NUnitTestAdapter version="2.0.0" .Net Framework 4.5.2

All packages are latest & installed from Nuget. There is no build error. We are getting error in test result window:

Attempt to load assembly with unsupported test framework in  D:\JuniorAchievement\Git\jaums\JA.UMS.Tests\bin\Debug\JA.UMS.Tests.dll

while running or debugging test using Visual Studio Test Explorer.

enter image description here

Test is able to run on one machine with same code on Visual Studio 2013 ultimate. We all other have Visual Studio 2013 professional version, although I doubt it has nothing to do with the problem.

Please Help.

Update

__________

After update to NUnit3 Test Adapter no error but still no test are discovered.

enter image description here

Somehow both Adapter are available but with Nuget & VS extension I can find only NUnit3 Test Adapter.

Installed NUnit3 Test Adapter from https://visualstudiogallery.msdn.microsoft.com/0da0f6bd-9bb6-4ae3-87a8-537788622f2d

Loophole answered 28/1, 2016 at 8:22 Comment(4)
Just update NUnit adapter.Madeira
Look at my comment here please https://mcmap.net/q/740914/-the-test-method-is-not-being-shown-in-test-explorer-vs2013 Maybe it will help.Incorporated
@DenisKoreyba, thanks I will try that, just got busy with something else.Loophole
It was my bad, Architecture was x86 in test settings, I changed to x64 & its working now.Loophole
G
20

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.

Gradient answered 28/1, 2016 at 9:47 Comment(7)
Updated, but still not getting any test in test explorer & also not able to debug test too. I also tried uninstalled nuget for NUnit2 Test Adapter & updating NUnit3 Test Adapter fro extensions. Is their any another test window for that?Loophole
Do you have a new error message? Can you run your test dll in the nunit console?Gradient
No error message. Just build occur & no test run after thatLoophole
This is the correct answer, but maybe you are running into additional problems. Is your test assembly PCL or another non-desktop assembly? You should see test discovery for the 3.0 adapter in the output window. Are there any new errors or messages?Noshow
@RobProuse, @ Chris I have udpated question, after using NUnit Test Adapter 3 still no test are discovered.Loophole
Thanks Chris, It was my bad, Architecture was x86 in test settings, I changed to x64 & its working now. Thanks for your help.Loophole
@Chris, he doesn't need the 2.0 adapter, but FYI, both adapters can be installed side-by-side if you work with a mix of 2.x and 3.0 tests.Noshow
P
5

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

enter image description here

Pennsylvania answered 28/7, 2016 at 12:42 Comment(0)
I
1

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.

Incinerator answered 5/10, 2016 at 10:16 Comment(0)
G
0

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

Gustafson answered 19/3, 2018 at 13:51 Comment(0)
A
0

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.

Attitudinize answered 16/5, 2018 at 2:39 Comment(1)
Hey, this looks like your first post here, welcome to the community. It is recommended to not answer older questions unless contributing something new that the other answers do not already cover, and this answer is essentially a duplicate of @Mohlala's answer 2 months ago.Ectype

© 2022 - 2024 — McMap. All rights reserved.