.net mstest.exe 在哪里?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2375481/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 14:01:48  来源:igfitidea点击:

Where is mstest.exe located?

.nettestingmstestfile-location

提问by George Mauer

I need to run mstest from the command line - where in the world is this exe located? Can anyone give me a clue?

我需要从命令行运行 mstest - 这个 exe 在哪里?谁能给我一个线索?

Edit:I only have Visual Studio 2010 installed

编辑:我只安装了 Visual Studio 2010

回答by Joey

for %x in (mstest.exe) do @echo.%~dp$PATH:x

from the Visual Studio Command Prompt is your friend. For me it's in

从 Visual Studio 命令提示符是你的朋友。对我来说它在

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\

回答by Loofer

Type

类型

where mstest.exe

into a Visual Studio Command Prompt...

进入 Visual Studio 命令提示符...

回答by dwonisch

Since Visual Studio 2012 (at least the express versions) MsTest.exe is called vstest.console.exeand can be found at

由于调用了 Visual Studio 2012(至少是快速版本)MsTest.exevstest.console.exe并且可以在以下位置找到

C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe

C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe

回答by Dave Kennedy

I stumbled across this post because I'm trying to automate some web tests.

我偶然发现了这篇文章,因为我正在尝试自动化一些 Web 测试。

You can run >mstest /TestContainer:some.webtest from the visual studio command prompt, sure - but when you slap that in a batch file the command prompt that's executed by default doesn't have the visual studio tools included.

您可以从 Visual Studio 命令提示符运行 >mstest /TestContainer:some.webtest ,当然 - 但是当您将其放入批处理文件中时,默认情况下执行的命令提示符不包含 Visual Studio 工具。

You can search for mstest.exe, but that location might not be the same across machine, so it's unwise to hardcode in c:\

您可以搜索 mstest.exe,但该位置在机器上可能不相同,因此在 c:\ 中进行硬编码是不明智的

Rany Miller's answer was god's send to me (thanks!) - he suggested %VS90COMNTOOLS%\..\IDE\MSTest.exe

Rany Miller 的回答是上帝送给我的(谢谢!) - 他建议 %VS90COMNTOOLS%\..\IDE\MSTest.exe

But that doesn't work if you have VS 2010. Just replace the 90 with 100. My batch file, that I can schedule as a task to run nightly, looks like this:

但是,如果您有 VS 2010,这不起作用。只需将 90 替换为 100。我的批处理文件,我可以安排为每晚运行的任务,如下所示:

SET SOURCEe=c:\myTestProjectFolder\
CD %SOURCE%
"%VS100COMNTOOLS%..\IDE\mstest.exe" /TestContainer:some.webtest

回答by Randy Minder

If you can't find it, try searching like this:

如果找不到,请尝试这样搜索:

%VS90COMNTOOLS%\..\IDE\MSTest.exe

回答by Alan Hymanson

My automated test scripts uses:

我的自动化测试脚本使用:

"%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe"  

The full command I use is:

我使用的完整命令是:

"%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe"  /testcontainer:[PathToTestDll] /resultsfile:[TrxOutputPath]

回答by Dominic Hopton

If you run a visual studio commmand prompt before you run your scripts -- which should be doable in most situations -- you can run %VSINSTALLDIR\Common7\IDE\mstest -- this means that you can move with the version of VS, and not have to react to director changes if users install in a different directory.

如果在运行脚本之前运行 Visual Studio 命令提示符——这在大多数情况下应该是可行的——你可以运行 %VSINSTALLDIR\Common7\IDE\mstest——这意味着你可以随着 VS 的版本移动,并且如果用户安装在不同的目录中,则不必对导演更改做出反应。

回答by Asad

"%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\IDE

回答by AndiDog

C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE

C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE

If people only knew that Windows can search for files...

如果人们只知道 Windows 可以搜索文件......

You can simply open up Visual Studio's command line prompt to include that directory in the PATH. Take a look at the start menu entry "Visual Studio 2008 Command Prompt".

您可以简单地打开 Visual Studio 的命令行提示符以将该目录包含在 PATH 中。查看开始菜单项“Visual Studio 2008 命令提示符”。