mstest.exe 位于哪里?

发布于 2024-08-23 12:36:32 字数 104 浏览 3 评论 0原文

我需要从命令行运行 mstest - 这个 exe 位于世界何处?谁能给我一个线索吗?

编辑:我只安装了 Visual Studio 2010

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

Edit: I only have Visual Studio 2010 installed

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

暖阳 2024-08-30 12:36:32
for %x in (mstest.exe) do @echo.%~dp$PATH:x

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

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\
for %x in (mstest.exe) do @echo.%~dp$PATH:x

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

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\
疯狂的代价 2024-08-30 12:36:32

输入...

where mstest.exe

在 Visual Studio 命令提示符中

Type

where mstest.exe

into a Visual Studio Command Prompt...

热鲨 2024-08-30 12:36:32

自 Visual Studio 2012(至少是 Express 版本)起,MsTest.exe 被称为 vstest.console.exe,可以在以下位置找到:

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

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

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

兲鉂ぱ嘚淚 2024-08-30 12:36:32

我偶然发现这篇文章是因为我正在尝试自动化一些网络测试。

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

您可以搜索 mstest.exe,但该位置在不同机器上可能不相同,因此在 c:\

Rany Miller 的答案中硬编码是不明智的(谢谢!) - 他建议 %VS90COMNTOOLS%\ ..\IDE\MSTest.exe

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

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

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

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.

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

Rany Miller's answer was god's send to me (thanks!) - he suggested %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:

SET SOURCEe=c:\myTestProjectFolder\
CD %SOURCE%
"%VS100COMNTOOLS%..\IDE\mstest.exe" /TestContainer:some.webtest
不忘初心 2024-08-30 12:36:32

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

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

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

%VS90COMNTOOLS%\..\IDE\MSTest.exe
温柔女人霸气范 2024-08-30 12:36:32

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

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

我使用的完整命令是:

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

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]
樱花细雨 2024-08-30 12:36:32

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

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.

不打扰别人 2024-08-30 12:36:32
"%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\IDE
"%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\IDE
以可爱出名 2024-08-30 12:36:32

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

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

您只需打开 Visual Studio 的命令行提示符将该目录包含在 PATH 中即可。看一下开始菜单条目“Visual Studio 2008 命令提示符”。

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

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文