Sdk: netcoreapp2.0 is not compatible with netstandard2.0 ?

Created on 13 Nov 2017  路  3Comments  路  Source: dotnet/sdk

Hi ,
I have 3 trivial projects here:

  • CommonLib.csproj with target netstandard2.0
  • OldImplement.csproj with target v4.7
  • NewImplement.csproj with target newcoreapp2.0

Here is the problem:

It works fine if I reference the OldImplement in the CommonLib, everything works find.

But when i try to change the referenced project from the OldImplement to the NewImplement, I cannot build the CommonLib. And here is the error I got when I run dotnet build for CommonLib:

error NU1201: Project NewImplement is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Project NewImplement supports: netcoreapp2.0 (.NETCoreApp,Version=v2.0)

I have .Net CLI 2.0.2 installed.

My questions is: is this error by design, or it is possible to reference a netcoreapp project in a netstandard library?

Most helpful comment

Hi @odytrice . The answer I got is: For new libraries, they should be implemented as netstandard. netcores and netfx could both reference netstandard projects, but not reverse. And everyone could reference netfx projects is for historical compatibility.

All 3 comments

Why was this closed? I have the same problem on a build server. Could it be that the right SDK is not installed?

Turns out I was making a netstandard2.0 project depend on netcoreapp2.0 application

Hi @odytrice . The answer I got is: For new libraries, they should be implemented as netstandard. netcores and netfx could both reference netstandard projects, but not reverse. And everyone could reference netfx projects is for historical compatibility.

Was this page helpful?
0 / 5 - 0 ratings