I have a project that I want to use .net core 2.0, which I believe is netcoreapp2.0. It also uses the nuget package created with .net 4.6.1. I have control over this nuget package and can change something if necessary. It has network standards 2.0, imported as a nuget package.
If I include cproj in my file:
<TargetFramework>netcoreapp2.0</TargetFramework>
I get this warning:
The package "Terryberry.Roes.Common 2017.9.29-mongo" was restored using ".NETFramework, Version = v4.6.1" instead of the target target platform .NETCoreApp, Version = v2.0. This package may not be compatible with your project.
along with errors that system.net.sockets is downgrading from 4.3 to 4.1. Nuget package 4.6.1 has System.Net.Sockets 4.3, so I'm not sure why it wants to downgrade.
Exact error for reference:
Packet Downgrade Detected: System.Net.Sockets from 4.3.0 to 4.1.0. Link to 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
I tried to configure both options:
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
This gives me warnings like:
'My461NugetPackage' ".NETFramework, Version = v4.6.1" .NETCoreApp, Version = v2.0. .
, net461, , .NetCoreApp
- System.Net.Sockets
, net461. , . , .
<TargetFramework>net461</TargetFramework>
:
: System.TypeLoadException: "ConfigureAppConfiguration" "Microsoft.AspNetCore.Hosting.WebHostBuilder" "Microsoft.AspNetCore.Hosting, Version = 1.1.2.0, Culture = neutral, PublicKeyToken = adb9793829ddae60" .
, / , .net . . .