简体   繁体   English

在命令行上运行MSTest时,测试失败,但在VS2012中通过

[英]Test Fails when running MSTest on commandline but passes in VS2012

I have one test out of a suite of tests that fails when running MSTest on the commandline. 我在命令行中运行MSTest时失败了一组测试中的一个测试。 However, the same suite of tests passes within VS2012 IDE. 但是,同一组测试在VS2012 IDE中通过。

I verified that the same test project dll is being executed on both commandline and VS2012 IDE. 我验证了在命令行和VS2012 IDE上都将执行相同的测试项目dll。

I verified this by commenting out a test method and observing MSTest report an updated test summary in which some other test failed which was passing before I commented out the test method. 我通过注释掉一种测试方法并观察MSTest报告来更新此测试摘要,以验证这一点,其中在我注释掉该测试方法之前,其他一些测试失败了。

Any suggestions? 有什么建议么?

If you are using VS 2012 or later, you should be using vstest.console.exe to run your tests. 如果您使用的是VS 2012或更高版本,则应使用vstest.console.exe运行测试。 Mstext.exe is left there for backward compatibility. Mstext.exe留在此处是为了向后兼容。 Using vstest.console.exe oftentimes fixes issues that only exist when run with mstest.exe. 经常使用vstest.console.exe修复仅与mstest.exe一起运行时才存在的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM