I have a load test which contains only a single unit test.
The unit test is of a function in C# which calls C++ code using C++/CLI wrapper.
It runs well without any exception.
The projects are
1)Business logic ->BusinessLogic.lib
2)Wrapper(takes Business Logic.lib)->Wrapper.dll
3)C# project(takes Wrapper.dll)
The load test on running says that Wrapper.dll is not found whereas the full application runs properly and even unit test doesn’t report any such error
The exact error is
Test method TestProject1.testTest.getstateTest threw exception: System.IO.FileNotFoundException: Could not load file or assembly ‘ManagedBL.dll’ or one of its dependencies. The specified module could not be found
where TestProject1 is the Test Project,testTest is the Test Class and getstateTest is the unit test
Is your load test part of a testing framework (NUnit et al) or is it part of your application?
If the load test is inside a testing framework, then check that the Wrapper.dll gets copied into the “staging” folder where the test framework outputs the DLL and executes the test. Furthermore, please specify exactly what the error message is when you run the load test.
Update
OK, so there are several things that could cause this issue:
ManagedBL.dllinto the test staging directory.BusinessLogic.libinto the staging directory.BusinessLogic.lib(i.e. is theBusinessLogic.liblinking into any other native libraries?)Technically, VS should copy the
ManagedBL.dllif you have added it to the C# project’s references; however, do check that it gets properly copied anyway (should be in the TestResults folder).To fix 2 and 3 you might have to do something like this: How to copy native libraries to the unit test staging directory in Visual Studio 2010
Finally, if all else fails, I would highly recommend that you get the Process Monitor and run it while your test is loading and use the filters to only show the information relative to your test process. Process Monitor should be able to tell you when your process fails to find a file/library.