执行Visual Studio的单元测试时没有安装Visual Studio使用命令行错误 [英] Error when executing visual studio unit tests without installing visual studio using command line

查看:1112
本文介绍了执行Visual Studio的单元测试时没有安装Visual Studio使用命令行错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要执行的Visual Studio的单元测试,而无需安装Visual Studio的。要做到这一点,我做了一些注册表更改和复制的dll的使用MSTest.exe文件的文件夹中必需的。但是,当我尝试使用命令行来执行测试的MSTest / noisolation /testcontainer:TestProject1.dll它显示下面的错误。

  

C:\工具\ MSTest的> MSTest的/ noisolation /testcontainer:TestProject1.dll   微软(R)测试执行命令行工具版本10.0.30319.1   版权所有(c)Microsoft公司。保留所有权利。

     

无法初始化单元测试扩展codedUITestAttribute':。无法创建TestClassExtensionAttribute('Microsoft.VisualStudio.TestTools.UITesting的一个实例codedUITestAttribute,Microsoft.VisualStudio.QualityTools codedUITestFramework ,版本= 10.0.0.0,文化=中性公钥= b03f5f7f11d50a3a')为单位测试延长'codedUITestAttribute':无法加载文件或程序集Microsoft.VisualStudio.QualityTools codedUITestFramework,版本= 10.0。 0.0,文化=中性公钥= b03f5f7f11d50a3a或它的某一个依赖。该系统找不到指定的文件。   斌\释放\ prjcco.dll   无法加载测试容器'BIN \发布\ prjcco.dll或它的某一个依赖。错误详细信息:System.IO.FileNotFoundException:无法加载文件或程序集Microsoft.VisualStudio.TestTools.UITesting,版本= 10.0.0.0,文化=中性公钥= b03f5f7f11d50a3a或它的某一个依赖。该系统找不到指定的文件。

解决方案

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

I want to execute visual studio unit tests without installing visual studio . To achieve this , I made some registry changes and copied the dll's required in a folder with MSTest.exe file . But when I try to execute the test using a command line "mstest /noisolation /testcontainer:TestProject1.dll" it showing the below error.

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.

解决方案

You need to include Microsoft.VisualStudio.TestTools.UITesting.dll.

这篇关于执行Visual Studio的单元测试时没有安装Visual Studio使用命令行错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆