Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSTest.exe gives assembly or module not found warning [duplicate]

I have a Visual Studio 2012 solution with a C# project and a test project which references the output of the C# project. The test project runs fine in Visual studio.

But if I run it with MSTest.exe in the Developer command prompt:

MSTest.exe /testcontainer:mytest.dll

it fails giving lots of warnings like:

Test Run deployment issue: The assembly or module 'Microsoft.SharePoint.Search.Extended.Query' directly or indirectly referenced by the test container '(path of mytest.dll)' was not found.

I dont think Visual Studio is copying the referenced dlls which are not part of the solution.

What is the solution to this ? how do i run my test suit with MSTest.exe

like image 441
AdCan Avatar asked Aug 29 '13 16:08

AdCan


1 Answers

  1. You can reference assemblies from GAC
  2. You can specify what files should be deployed alongside your compiled test assembly before tests are run with DeploymentItemAttribute on test method.
like image 61
alex Avatar answered Nov 13 '22 12:11

alex