FileNotFoundException when running NUnit tests from TeamCity

I use the built-in TeamCity NUnit runner to run tests stored in .DLL files.

My .DLLs refer to other DLL files that are present in the same folder.

When I run them, I get a FileNotFoundException for the linked DLLs.

How can i fix this? I think it is possible that the TC NUnit runner uses some other directory as the main folder for executing the application and thereby prevents the files that are actually located next to the test DLL not loading properly, but until they can prove this statement ...

Has anyone else encountered this behavior?

+7
source share
3 answers

OK the problem is resolved and it is really stupid and awkward:

I installed the NUnit test runner to run these tests:

**/*.Tests.dll 

This means that it will include tests from /bin/Debug/ , as well as from other folders, for example obj/

In these folders, of course, no links are included, causing the same tests to run twice, and some of them fail, of course!

+9
source

The paths are associated with the assembly directory, and not with any working directory. If you need other paths, use the %reference% syntax to reference the TeamCity property using the directory path. Do you run it under Windows? Are you using TeamCity 6.5?

If this does not help, you can contact the city-feedback@jetbrains.com team for free

+1
source

In my case, the missing DLL was a native library, and it could not be loaded because the incorrect version of the VC runtime was installed in the build agent. My solution was to directly add executable DLLs (located in "C: \ Program Files (x86) \ Microsoft Visual Studio 11.0 \ VC \ redist \ x86 \ Microsoft.VC110.CRT ') directly into the project (build action = Content , copy to output directory = Always Copy.) This also simplifies installation.

Hope this helps.

0
source

All Articles