Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 如何启动MSTest并从批处理文件运行命令?_Batch File_Command Line_Command Prompt_Mstest - Fatal编程技术网

Batch file 如何启动MSTest并从批处理文件运行命令?

Batch file 如何启动MSTest并从批处理文件运行命令?,batch-file,command-line,command-prompt,mstest,Batch File,Command Line,Command Prompt,Mstest,我正在创建一个批处理文件,以便构建所有解决方案,然后运行位于先前构建的dll中的所有单元测试 我正试着做一些类似的东西 start "%VS140COMNTOOLS%..\IDE\mstest.exe" MSTest /testcontainer:tests.dll 启动MSTest.exe并在MSTest命令行中运行“MSTest/testcontainer:tests.dll”命令,但这不起作用 有人能帮我吗?谢谢。我解决了我的问题 我必须在没有start和MSTest标志的情况下运行,

我正在创建一个批处理文件,以便构建所有解决方案,然后运行位于先前构建的dll中的所有单元测试

我正试着做一些类似的东西

start "%VS140COMNTOOLS%..\IDE\mstest.exe"  MSTest /testcontainer:tests.dll
启动MSTest.exe并在MSTest命令行中运行“MSTest/testcontainer:tests.dll”命令,但这不起作用

有人能帮我吗?谢谢。

我解决了我的问题

我必须在没有
start
MSTest
标志的情况下运行,例如:

"%VS140COMNTOOLS%..\IDE\mstest.exe"  /testcontainer:tests.dll

感谢您的帮助。

尝试使用
start”“%VS140COMNTOOLS%..\IDE\mstest.exe“mstest/testcontainer:tests.dll
,因为
start
命令可能会将
.exe
文件路径解释为窗口标题,因为它是第一个引用的参数……感谢您的评论。它起作用了,但仍然不能解决问题。现在,MSTest.exe启动,但该命令不执行任何操作。它看起来像是在cmd中的所有组件加载之前执行的,因为没有显示欢迎消息。为什么在其中有额外的MSTest参数?此外,如果您支持旧版VS2010项目,则只应使用
mstest.exe
。否则,您应该使用
vstest.console.exe
。删除MSTest和删除start使其正常工作。我只有一个MSTest参数,因为在MSTest.exe中使用了这种方式。这对我很有帮助。如果测试dll位于子文件夹中,请添加如下路径:“%VS140COMNTOOLS%..\IDE\mstest.exe”/testcontainer:myTestProject\bin\Debug\myTestProject.dll