14

I'm building and deploying a solution from Visual Studio 2015 using TFS 2012 without issues. I have decided to incorporate my unit tests as part of the prerequisites for the build process.

Independent of the msbuild process, the unit tests run without issue and succeed; however, when I incorporate them as part of my build process I am getting the following exception in my build:

Exception NUnit.Core.UnsupportedFrameworkException, Exception thrown executing tests in D:\Builds\4\PA1111CE\Dev1111dBus\bin\mmmTests.dll
 No test is available in D:\Builds\4\PA1111CE\Dev1111dBus\bin\mmmTests.dll. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.

The build partially succeeds.

In order to make sure that tests are run, I've set the Disable Tests property within Process to false:

enter image description here

In addition to this I've set options for Automated Tests:

enter image description here

The only test runners which are available are as follows:

enter image description here

also, per my extensions and updates, it is showing that I indeed DO have nunit adapter 3 installed:

enter image description here

What am I doing wrong? Why does my build only partially succeed?

3
  • I got the same error... Did you manage to solve it?
    – Engern
    Commented Feb 10, 2016 at 13:27
  • Which NUnit framework version and test adapter version are you using? Commented Feb 15, 2016 at 8:10
  • Which version of the .NET framework does your test project target in Project Properties? The build partially succeeds because while the build is successful, the unit testing is not. Commented Feb 23, 2016 at 17:29

4 Answers 4

15

The message indicates that you are trying to run NUnit tests using the wrong Visual Studio adapter. Use the 2.0 adapter for NUnit 2.x tests and the 3.0 adapter for NUnit 3.0 tests.

If you have both adapters installed, each one will run the tests for which they are designed. Each of them will display a message in for any assembly that they do not support. The message isn't meant to be an error and we try to word it in such a way that it won't be taken as such. However, we felt we have to give it just in case you expected the assembly to be handled by that particular adapter. Passing it by silently seems wrong.

When running under the VS IDE, the message does not cause a failure in the test run. It appears that running under TFS does cause a failure. If memory serves, we fixed this problem for the NUnit 3 adapter but not (yet) for the NUnit 2 adapter.

8
  • charlie thank you, please look at the image that i've added to this post, this shows that nunit test runner is just not available Commented Feb 4, 2016 at 11:37
  • @Charlie, I have the same problem as Engern. I have NUnit 3.2.1 installed but the NUnitTestAdaptor.2.0.0 is in my 'packages' folder. Where do I find the correct 3.2.1 adapter for VS 2013? Commented Apr 26, 2016 at 14:31
  • 1
    The error should go away if you add the NUnit3TestAdapter package.
    – D Maxim
    Commented May 12, 2016 at 12:54
  • 2
    For reference, our project had both 2.x and 3.x test adapters installed. This caused all tests to run normally, as well as fail with this error. Removing the 2.x test adapter resolved this.
    – Joshua C
    Commented Aug 18, 2016 at 19:40
  • I updated my answer to deal with the situation where two adapters are installed.
    – Charlie
    Commented Aug 19, 2016 at 16:51
5

I had the same problem on my build server when using NUnit 3 via NuGet. I uninstalled NUnit 2 and 3 test adapters from Visual Studio, and NUnit 2 from the machine. I still had the problem.

In my case the issue was caused by 4 NUnit2 DLLs hiding in :

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions

As soon as they were deleted the TFS build executed perfectly.

3

I had the same exact issue. I use NUnit 3.2.1, and had NUnit test adapters 2.0 and 3.0 installed.

I couldn't figure out how to switch adapters, so I disabled the 2.0 one. Now I get no errors (even though it was only a message like you - test passed/failed as they should have).

To disable 2.0 test adapter (also maybe install 3.0): Tools -> Extensions and Updates -> Search or locate Nunit 2.0 and click disable or uninstall.

1
  • Yeah, this is important, but how did you disable the 2.0 one? Through Visual Studio? Commented May 19, 2016 at 23:13
1

Found this article, but I have not tested it myself: NUnit failed to load in TFS build

I ended up temporarily excluding my unittest-project from the build like described here

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.