2

我想在不安装 Visual Studio 的情况下执行 Visual Studio 单元测试。为此,我进行了一些注册表更改,并将所需的 dll 复制到带有 MSTest.exe 文件的文件夹中。但是当我尝试使用命令行“mstest /noisolation /testcontainer:TestProject1.dll”执行测试时,它显示以下错误。

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.
4

1 回答 1

4

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

于 2012-07-16T13:01:53.830 回答