title: How to target netcoreapp2.0 and net461 in the same project
body: <p>I've got a project that I want to use .net core 2.0, which I believe is netcoreapp2.0. It is also using a nuget package that is created with .net 4.6.1. I have control over this nuget package and can change something there if need be. It does have netstandards 2.0 imported as a nuget package.</p>
  
  <p>If I include in my cproj file:</p>
  
  <pre><code>    &lt;TargetFramework&gt;netcoreapp2.0&lt;/TargetFramework&gt;
  </code></pre>
  
  <p>I get this warning :</p>
  
  <p>Package 'Terryberry.Roes.Common 2017.9.29-mongo' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project.</p>
  
  <p>along with errors about system.net.sockets being downgraded from 4.3 to 4.1. The 4.6.1 nuget package has System.Net.Sockets 4.3 so I'm not sure why it wants to downgrade.</p>
  
  <p>The exact error for reference:</p>
  
  <p>Detected package downgrade: System.Net.Sockets from 4.3.0 to 4.1.0. Reference the package directly from the project to select a different version. 
   MyNetCoreProject  (>= 2017.2.0) -> Microsoft.VisualStudio.Web.BrowserLink (>= 1.1.2) -> Microsoft.Extensions.FileProviders.Physical (>= 1.1.1) -> NETStandard.Library (>= 1.6.1) -> System.Net.Sockets (>= 4.3.0) 
   MyNetCoreProject  (>= 2017.2.0) -> Microsoft.VisualStudio.Web.BrowserLink (>= 1.1.2) -> System.Net.Sockets (>= 4.1.0)  MyNetCoreProject </p>
  
  <p>I tried targeting both:</p>
  
  <pre><code>    &lt;TargetFrameworks&gt;net461;netcoreapp2.0&lt;/TargetFrameworks&gt;
  </code></pre>
  
  <p>This gives me warnings like :</p>
  
  <p>Package 'My461NugetPackage' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project.</p>
  
  <p>This confuses me too because now I added net461 and it says its going to build it with .NetCoreApp</p>
  
  <p>There are still errors about downgrading System.Net.Sockets</p>
  
  <p>I then decided I was willing to try just net461. Just to see if it would compile. It does, but I get a runtime error.</p>
  
  <pre><code>    &lt;TargetFramework&gt;net461&lt;/TargetFramework&gt;
  </code></pre>
  
  <p>This gave me:</p>
  
  <p>Unhandled Exception: System.TypeLoadException: Method 'ConfigureAppConfiguration' in type 'Microsoft.AspNetCore.Hosting.WebHostBuilder' from assembly 'Microsoft.AspNetCore.Hosting, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation.</p>
  
  <p>I've tried doing some research, but there is a lot of old/obsolete information about there as .net core is evolving. I haven't been able to figure this out. Any guidance would be appreciated.</p>