VSTest: A testsettings file or a runsettings with a ForcedLegacyMode set to true is not supported with the MSTest V2 Adapter. No test is available

喜夏-厌秋 提交于 2019-12-03 06:25:35
Maheswari Ramalingam

I had the similar problem and I have resolved it the following way:

  1. Go to Test -> Test Settings

  2. Uncheck the \..\..projectTestSettings.testsettings file

  3. Run the tests again

The solution is to use Microsoft.VisualStudio.QualityTools.UnitTestFramework instead of Microsoft.VisualStudio.TestPlatform.TestFramework which is added to your unit test project by Visual Studio by default. So you can remove two packages via NuGet. You should delete MSTest.TestAdapter and MSTest.TestFramework and install Microsoft.VisualStudio.QualityTools.UnitTestFramework.Updated. Your unit tests will be discovered after these steps.

Also you can read the following useful article about test framework MSTest V2.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!