title: xUnit tests run locally but not on Azure DevOps
body: <p>I have xUnit tests which run fine locally but do not get run on Azure DevOps.  The assembly under test is a .NET 5.0 assembly as is the test assembly.</p>
  <p>Examining the log file from the VsTest task, I see the following</p>
  <blockquote>
  <p>Test run detected DLL(s) which were built for different framework and platform versions. Following DLL(s) do not match current settings, which are .NETFramework,Version=v5.0 framework and X86 platform.</p>
  </blockquote>
  <blockquote>
  <p>UnitTests.dll is built for Framework .NETCoreApp,Version=v5.0 and Platform AnyCPU.</p>
  </blockquote>
  <blockquote>
  <p>Microsoft.TestPlatform.CommunicationUtilities.dll is built for Framework .NETStandard,Version=v2.0 and Platform AnyCPU.</p>
  </blockquote>
  <blockquote>
  <p>Microsoft.TestPlatform.CoreUtilities.dll is built for Framework .NETStandard,Version=v2.0 and Platform AnyCPU.</p>
  </blockquote>
  <blockquote>
  <p>Microsoft.TestPlatform.CrossPlatEngine.dll is built for Framework .NETStandard,Version=v2.0 and Platform AnyCPU.</p>
  </blockquote>
  <blockquote>
  <p>Microsoft.TestPlatform.PlatformAbstractions.dll is built for Framework .NETCoreApp,Version=v2.1 and Platform AnyCPU.</p>
  </blockquote>
  <blockquote>
  <p>Microsoft.TestPlatform.Utilities.dll is built for Framework .NETStandard,Version=v2.0 and Platform AnyCPU.</p>
  </blockquote>
  <blockquote>
  <p>Microsoft.VisualStudio.TestPlatform.Common.dll is built for Framework .NETStandard,Version=v2.0 and Platform AnyCPU.</p>
  </blockquote>
  <blockquote>
  <p>Microsoft.VisualStudio.TestPlatform.ObjectModel.dll is built for Framework .NETStandard,Version=v2.0 and Platform AnyCPU.</p>
  </blockquote>
  <blockquote>
  <p>testhost.dll is built for Framework .NETCoreApp,Version=v2.1 and Platform AnyCPU.</p>
  </blockquote>
  <blockquote>
  <p>xunit.runner.visualstudio.dotnetcore.testadapter.dll is built for Framework .NETCoreApp,Version=v2.1 and Platform AnyCPU.</p>
  </blockquote>
  <blockquote>
  <p>Go to <a href="http://go.microsoft.com/fwlink/?LinkID=236877&amp;clcid=0x409" rel="noreferrer">http://go.microsoft.com/fwlink/?LinkID=236877&amp;clcid=0x409</a> for more details on managing these settings.</p>
  </blockquote>
  <p>The link does not really help much (perhaps the content has changed).  I have tried changing this using commandline arguments in my Build task: /Framework:net50 /Platform:x64 (AnyCPU does not seem to be a valid option.)</p>
  <p>... and also by using a .runsettings file (linked in my build task)</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;RunSettings&gt;
    &lt;RunConfiguration&gt;
      &lt;TargetPlatform&gt;x64&lt;/TargetPlatform&gt;
      &lt;TargetFrameworkVersion&gt;net50&lt;/TargetFrameworkVersion&gt;
    &lt;/RunConfiguration&gt;
  &lt;/RunSettings&gt;
  </code></pre>
  <p>... and also by linking to the BuildPlatform for the pipeline.</p>
  <p>Regardless of any of these changes, the errors in the log file (and also the current settings listed in the first sentence) remain the same.</p>