MSTests 在命令行失败,但在 Visual Studio 2017 IDE 中工作

MSTests 在命令行失败,但在 Visual Studio 2017 IDE 中工作

问题描述:

我正在尝试使用命令行配置命令行构建.

I am trying to configure a command line build using the command line.

我在 Windows Server 2016 上安装了 Visual Studio 2017.

I have Visual Studio 2017 installed on Windows Server 2016.

我已经安装了所有构建工具,它们似乎都可以工作.

I have installed all the build tools and they seem to work.

当我在 Visual Studio 2017 IDE 中运行我的 MSTest 单元测试时,它们都通过了.

When I run my MSTest unit tests in Visual Studio 2017 IDE they all pass.

当我在命令行运行它们时,有些通过,有些失败.

When I run them at the command line some pass and some fail.

有人能告诉我可能出了什么问题或如何解决吗?通常,当测试失败时,它会在 IDE 中失败,因此我可以对其进行调试.在这种情况下,我无法调试它,因为它通过了.

Can someone tell me what might be wrong or how to figure it out? Normally when a test fails it fails in the IDE so I can debug it. In this case I can't debug it because it passes.

使用 vstest.console.exe 运行您的测试.mstest.exe 的存在仅仅是为了向后兼容.

Use vstest.console.exe to run your tests. mstest.exe exists solely for backwards compatibility.

请参阅 MSDN 文档了解更多信息.

See the MSDN docs for more info.