יום ראשון 04 מרץ 2012 14:47
I am having trouble with my MSTest project. I am trying to test my C++ native .libs using a MSTest project. This worked well initially, but out of the blue it has stopped finding the DLL and all tests with this message: -
Error loading E:\Workspace\trunk\Sirocco\working\code\SiroccoVS2005\Release\DefaultTest.dll: Could not load file or assembly 'DefaultTest.dll' or one of its dependencies. The specified module could not be found.
It is the first time I've used MSTest, so I'm not really sure what to try, I've tried some googling, but I couldn't find anything that worked (I tried changing to AnyCPU from Win32)
Any ideas or workarounds I could try?
Thanks for your help!
All the best,
יום שני 05 מרץ 2012 07:22מנחה דיון
When did you get the "Could not load file or assembly" error message you offered above? When you run the tests or when you build solution?
In addition, please also make sure that you have setup or created test project correctly in order to create unit tests for native C++. You need to write the unit tests in C++ or CLI, and then configure the Change the Common Language RunTime Support property of test project to be Common Language RunTime Support (/clr).
Please take a look at this blog for further information about how to create unit tests for native C++:
Vicky Song [MSFT]
MSDN Community Support | Feedback to us
יום שני 05 מרץ 2012 08:26
It was when I built the solution, I couldn't run the tests either. I found the problem last night before I went to sleep. I had added a few more tests to the project which depended on the Poco library, therefore I needed to add the Poco dlls in order for the tests to run.
Could I suggest that VS names the dll it couldn't find as it would make life a little easier for devs. I managed to find what dll it was looking for by loading DefaultTest.dll into dependency walker ( http://www.dependencywalker.com/ ), I hope this helps other devs.
Thanks for your help, sorry I didn't reply last night,
All the best,
PS. I think I used that guide (native tests) previously when setting up the project, it was really useful.
- סומן כתשובה על-ידי Ash McC יום שני 05 מרץ 2012 08:26