ya23
ya23

Reputation: 14496

NUnit reference binaries in other directory

I'm running the NUnit tests and everything is fine as long as the required dlls are in the same directory as tests. Otherwise I get the error "Could not load file or assembly". NUnit console doesn't seem to have any switch to include default path, nor it uses system PATH variable while looking for assemblies.

The question is how to reference binaries that are in a directory other then tests itself. I don want to avoid mixing test and shipping binaries within a directory. Sure, I could copy everything/remove test dlls, but it feels hacky.

Upvotes: 0

Views: 764

Answers (2)

Pedro
Pedro

Reputation: 12328

On the machine in question, create an environment variable "DEVPATH" and set the value to the path for your assemblies. Then, within nunit.exe.config, add the following within the \configuration\runtime\ section:

<developmentMode developerInstallation="true" />

Upvotes: 1

Gerrie Schenck
Gerrie Schenck

Reputation: 22368

Write tests in a seperate project which references all the other projects.

Are you using Visual Studio .Net? Then you can choose to not include this project when you make a release build.

Test code should never reach production.

Upvotes: 0

Related Questions