title: .NET Core how to test with net461 and xunit
body: <p><code>dotnet new xunit</code> ->
  <code>dotnet restore</code> ->
  <code>dotnet test</code></p>
  
  <p>Total tests: 1. Passed: 1. Failed: 0. Skipped: 0.
  Test Run Successful.
  Test execution time: 1,7148 Seconds.</p>
  
  <p>.csproj; change target framework to net461:
  </p>
  
  <pre><code>  &lt;PropertyGroup&gt;
      &lt;TargetFramework&gt;net461&lt;/TargetFramework&gt;
    &lt;/PropertyGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" /&gt;
      &lt;PackageReference Include="xunit" Version="2.2.0" /&gt;
      &lt;PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" /&gt;
    &lt;/ItemGroup&gt;
  
  &lt;/Project&gt;
  </code></pre>
  
  <p>then 
  <code>dotnet restore</code> ->
  <code>dotnet test</code></p>
  
  <pre><code>Starting test execution, please wait...
  No test is available in C:\Projects\testing\bin\Debug\net461\testing.dll. Make sure that installed test discoverers &amp; executors, platform &amp; framework version sett
  ings are appropriate and try again.
  </code></pre>
  
  <p>How am I supposed to test net461-projects with xunit?
  I already have a big project I've upgraded from .NET Core 1.0, and testing worked fine before the upgrade, so changing test framework would require some work.</p>
  
  <p><strong>Update</strong></p>
  
  <p>As it turns out, this is probably not related to xunit and testing - ASP.NET Core projects targeting net461 won't run at all on my machine anymore, neither through VS or from cmd.</p>
  
  <p>The project I am trying to run is an new empty web project from the VS template. The csproj looks like this:</p>
  
  <pre><code>&lt;Project Sdk="Microsoft.NET.Sdk.Web"&gt;
  
    &lt;PropertyGroup&gt;
      &lt;TargetFramework&gt;net461&lt;/TargetFramework&gt;
      &lt;RuntimeIdentifier&gt;win7-x86&lt;/RuntimeIdentifier&gt;
    &lt;/PropertyGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;Folder Include="wwwroot\" /&gt;
    &lt;/ItemGroup&gt;
    &lt;ItemGroup&gt;
      &lt;PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" /&gt;
      &lt;PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" /&gt;
    &lt;/ItemGroup&gt;
  
  &lt;/Project&gt;
  </code></pre>
  
  <p>The error I get is this:</p>
  
  <pre><code>dotnet run
  
  Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.Hosting, Version=1.1.1.0, Culture=neutral, PublicKeyTo
  ken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified.
     at WebApplication2.Program.Main(String[] args)
  </code></pre>
  
  <p>I have tried removing all traces of Visual Studio and .NET Core from my machine and reinstalling them, but the error is the same.</p>