title: 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
body: <p>How to use <code>.testsettings</code> file running unit tests via <code>vstest.console.exe</code>? I created empty visual studio solution, created empty unit test project, added <code>Local.testsettings</code> file as a solution item.  </p>
  
  <pre><code>[TestClass]
  public class UnitTest1
  {
      [TestMethod]
      public void TestMethod1()
      {
  
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/0XR7T.png" rel="noreferrer"><img src="https://i.stack.imgur.com/0XR7T.png" alt="enter image description here"></a></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;TestSettings name="Local" id="1109524d-9809-4423-b7fa-fad429ebfd8d" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"&gt;
    &lt;Description&gt;These are default test settings for a local test run.&lt;/Description&gt;
    &lt;Deployment enabled="false" /&gt;
    &lt;Execution hostProcessPlatform="MSIL"&gt;
      &lt;TestTypeSpecific&gt;
        &lt;UnitTestRunConfig testTypeId="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b"&gt;
          &lt;AssemblyResolution&gt;
            &lt;TestDirectory useLoadContext="true" /&gt;
          &lt;/AssemblyResolution&gt;
        &lt;/UnitTestRunConfig&gt;
      &lt;/TestTypeSpecific&gt;
      &lt;AgentRule name="LocalMachineDefaultRole"&gt;
      &lt;/AgentRule&gt;
    &lt;/Execution&gt;
    &lt;Properties /&gt;
  &lt;/TestSettings&gt;
  </code></pre>
  
  <p>Everything is ok when I run my tests with following command:</p>
  
  <pre><code>&gt;&gt; "[path to vstest]/vstest.console.exe" [path to project]\UnitTestProject1.dll
  </code></pre>
  
  <p>The command below gives an error. </p>
  
  <pre><code>"[path to vstest]/vstest.console.exe" [path to project]\UnitTestProject1.dll /Settings:[path to settings file]\Local.testsettings
  </code></pre>
  
  <blockquote>
    <p>Warning : A testsettings file or a runsettings with a ForcedLegacyMode
    set to true is not supported with the MSTest V2 Adapter. No test is
    available in [path]\UnitTestProject1.dll. Make sure that test
    discoverer &amp; executors are registered and platform &amp; framework version
    settings are appropriate and try again.</p>
    
    <p>Additionally, path to test adapters can be specified using
    /TestAdapterPath command. Example 
    /TestAdapterPath:.</p>
  </blockquote>
  
  <p>So I added <code>/TestAdapterPath:[project path/bin/Debug]</code> parameter. The <code>Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll</code> with discoverer and executor is situated here. But I got the same error without the last sentence about specifying test adapter.</p>
  
  <p>I was wondering if someone could solve this problem. </p>