Kamil N.
Kamil N.

Reputation: 208

WP8 Unit test FileNotFoundException only while using MSTest.exe

I created a new Windows Phone Unit Test project for WP8. It works fine when started directly from visual studio, but when I run it from VS Command Prompt using MSTest.exe I get the following errors:

System.IO.FileNotFoundException: Can not load file 'System.Windows, Version=2.0.6.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies.

System.IO.FileNotFoundException: Can not load file 'Microsoft.Phone, Version=8.0.0.0, Culture=neutral, PublicKeyToken=24eec0d8c86cda1e' or one of its dependencies.

No dependencies beside the ones from project template have been added. Any ideas what is causing this and how to solve this error ? It's vital for me to run the tests from MSTest.exe by a third party application, not the VS itself.

Upvotes: 1

Views: 1053

Answers (1)

Nogard
Nogard

Reputation: 1789

Have you looked at VSTest.Console.exe tool? It is a replacement of MSTest.exe in Visual Studio 2012. You can read more about it here

It fully supports Windows Phone 8. Take a look at this guide on how to run tests from command-line.

If switching to the new framework is not an option, there is an answer on SO regarding running MSTest.exe with Windows Phone 8. Look at point 4 - there describes how to copy right assemblies into project.

At the moment I don't have IDE to check your scenario with provided tools, but will provide update with test results as soon as possible.

Upvotes: 1

Related Questions