Could not load file or assembly 'nunit.framework' or one of its dependencies...


I am trying to set up an NUnit build step to show code coverage as to run my tests. For some reason, in the artifact stage I get an error which results in a code -2 build failure.

On the bright side, the code coverage as well as the test results are still displayed. On the other hand, I have no clue what the issue is, and I don't really like not knowing.

I get this using both NUnit 3.4.1 as well as 3.2.1. The problem is also unaffected when upgrading from Teamcity 10.0.1 to 10.0.2.

Note that I did not get this using NUnit 2.6.4.


Build Log :

Teamcity Overview :

Build Step 1 (MSBuild) :

Build Step 2 (NUnit) :

Comment actions Permalink
Official comment

Hi Loic Huss

Could you specify the list of assemblies more precisely (for example `**/bin/**/*.Tests.dll`). Looks like your pattern includes an assembly in the directory `obj\..` that has not all dependencies.

Comment actions Permalink

Thank you Nikolay, that was it! 

Now that you point it out, that's probably the first thing I should've tried... (oops)

Comment actions Permalink

This question arises quite often :) Is it useful to have some additional comment on the web page or a sample in the documentation could be enough?

Comment actions Permalink

I feel like a small sample in the documentation should work well enough.


Please sign in to leave a comment.