2012-07-16 74 views
2

我想在不安装visual studio的情况下执行visual studio单元测试。为了达到这个目的,我做了一些注册表修改,并将MSTest.exe文件所需的dll文件复制到一个文件夹中。但是当我尝试使用命令行“mstest/noisolation /testcontainer:TestProject1.dll”执行测试时,它显示下面的错误。执行visual studio单元测试时出错,但没有使用命令行安装visual studio

C:\Tools\mstest>mstest /noisolation /testcontainer:TestProject1.dll 
Microsoft (R) Test Execution Command Line Tool Version 10.0.30319.1 
Copyright (c) Microsoft Corporation. All rights reserved. 

Failed to initialize the unit test extension 'CodedUITestAttribute': Failed to create an instance of the TestClassExtensionAttribute ('Microsoft.VisualStudio.TestTools.UITesting.CodedUITestAttribute, Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') for the unit test extension 'CodedUITestAttribute': Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. 
bin\release\prjcco.dll 
Unable to load the test container 'bin\release\prjcco.dll' or one of its dependencies. Error details: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. 
+0

我不知道你是否已经考虑过这个路径并决定反对它,但是看起来你试图实现的目标可以通过使用测试代理变得更容易。您仍然需要一个运行Visual Studio的系统,但测试会在只安装了测试代理的远程机器上运行。 http://msdn.microsoft.com/en-us/library/ms243155.aspx – mjohnsonengr 2012-07-16 19:34:57

回答

4

您需要包含Microsoft.VisualStudio.TestTools.UITesting.dll。

+0

我们应该在哪个文件夹中包含程序集? – falkon21 2017-01-19 11:15:35

+1

@RicardoCosta:EXE文件夹(它从中加载程序集)。 – SLaks 2017-01-19 17:59:45

相关问题