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

后端 未结 2 1556
眼角桃花
眼角桃花 2020-12-31 10:30

How to use .testsettings file running unit tests via vstest.console.exe? I created empty visual studio solution, created empty unit test project, a

相关标签:
2条回答
  • 2020-12-31 10:50

    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.

    0 讨论(0)
  • 2020-12-31 11:00

    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

    0 讨论(0)
提交回复
热议问题