0

I have an automation test suite in Visual Studio 2012, using MsTest.

I can successfully run test via Visual Studio using MsTest and Resharper.

But when I try to run my MsTests via command prompt the following error is returned:

Run has the following issue(s):
Warning: Test Run deployment issue: The assembly or module 'System.Data.SqlServerCe' directly or indirectly referenced by the test container 'c:\project.dll' was not found.

To fix this I have tried:

Adding System.Data.SqlServerCe reference to my project.

Setting the reference setting 'Copy Local' = True

Edited my file: vstest.executionengine.x86.exe with

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <qualifyAssembly partialName="System.Data.SqlServerCe" fullName="System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
    </assemblyBinding>

Also Edited my app.config to incude the same assemblyBinding as above.

None of these worked. So this error is only seen when I try to run my tests via command prompt.

Any thoughts folks?

Benny Meade
  • 602
  • 10
  • 25

1 Answers1

0

I will answer my own question here:

It turned out that the warning above was not my issue. When I went back to VS Resharper settings and ticked the checkbox for legacy, I started to get the same error as Mstest via CMD.

But the error message was more detailed in this view. And basically I had to add all relevant DLL's (Ranorex in this case) to the GAC one by one until the error stopped occurring.

Eg. GAC command:

C:\Program Files (x86)\Microsoft Visual Studio 11.0>gacutil /i "C:\ThirdPartyTools\Ranorex\Ranorex.Core.dll"
Benny Meade
  • 602
  • 10
  • 25
  • 1
    Did you try using additional folders for discovering dependent assemblies in mstest settings [msdn link](http://msdn.microsoft.com/en-us/library/ee256991.aspx#VSTestSettingsUnitTest)? May be that could solve your problem, GAC'ing dependent assemblies is not a good idea. – Arun M Feb 07 '14 at 14:27