unit testing - vstest.console throws System.IO.FileNotFoundException -


There are several unit testing projects in my application, all other projects and unit test projects have been created in a normal output directory. Along with, I am collecting all the unit testing assemblies and running vstest.console.exe to test these assemblies.

  "C: \ Program Files (x86) \ Microsoft Visual Studio 11.0 \ Common 7 \ Tools \. \ IDE \ Common Extensions \ Microsoft \ TestWindow \ vstest.console.exe" "Assembly1 UnitTest.dll "" Assembly2.UnitTest.dll "/ Platform: x64 / Framework: Framework 40 / Insolation / Logger: trx   

This is the result of an exception: System.IO.FileNotFoundException: Could not load one of the files or assemblies 'someassembly.dll' or its dependencies. The specified module was not found.

When I execute vstest.console.exe for one unit tests, the above exception does not occur. From further investigation I came to know that once once the vest. If the console examines many assemblies then the test is copying the assemblies and dependent assemblies in an "outside" directory in the "test" directory, however all necessary assemblies are not referred by a project but manually in the normal output directory Is copied. Those assemblies are unavailable in the "Out" directory in "Examinations" and are due to the system.IO.FileNotFoundException.

With MSTest I can use a config file to add a tool to a device in the normal output directory. For Vstest.console it does not work anymore.

What can I do around this behavior? I do not want to work with an "outside" directory. It is okay to run my unit tests from the normal output directory.

PS I have the same issue on TFS 2013 with definitions. My Construction Definitions * .unittest.dlls are collecting and executing them with Test Runner.

The solution is to specify "DeploymentEnabled" in the renditions file by using the .runsettings file, by default this is true. Changing it to false does not copy all the assemblies into the external directory of the Test Result directory. More information on Running File:.

Example:

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; RunSettings & gt; & Lt ;! - Info: http://msdn.microsoft.com/en-us/library/jj635153.aspx - & gt; & Lt; MSTest & gt; & Lt; IgnoreTestImpact & gt; This is true & lt; / IgnoreTestImpact & gt; & Lt; MapInconclusiveToFailed & gt; This is true & lt; / MapInconclusiveToFailed & gt; & Lt; CaptureTraceOutput & gt; False & lt; / CaptureTraceOutput & gt; & Lt; DeleteDeploymentDirectoryAfterTestRunIsComplete & gt; This is true & lt; / DeleteDeploymentDirectoryAfterTestRunIsComplete & gt; & Lt; DeploymentEnabled & gt; False & lt; / DeploymentEnabled & gt; & Lt; / MSTest & gt; & Lt; / RunSettings & gt;    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -