6

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

Gustavo Mori
  • 8,319
  • 3
  • 38
  • 52
AdCan
  • 127
  • 2
  • 10
  • I had a similar issue and got the solution here: http://stackoverflow.com/a/15133291/914033 He proposes to use vstest.console.exe instead of mstest.exe, and it worked for me! – RubenJMarrufo Feb 10 '14 at 17:45
  • 1
    I wonder how it can be a warning that an assembly or module is not found. Shouldn´t it be an error? – Anders Lindén Jan 13 '16 at 12:21

1 Answers1

1
  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.
alex
  • 12,464
  • 3
  • 46
  • 67
  • Thanks alex. But can you please elaborate on the 2nd point. Since I have a lot of references missing, i cannot GAC every singele reference. – AdCan Aug 30 '13 at 08:39
  • In case this is of interest, I had an issue with a *specific* assembly not found and the accepted answer to this question helped me solve it: [EntityFramework.SqlServer not deployed in web publish](http://stackoverflow.com/questions/20499148/entityframework-sqlserver-not-deployed-in-web-publish?lq=1). – mungflesh Mar 24 '15 at 12:16