.netuwp.net-core.net-native

Why can't I add a reference to a .NET Core 2.0 Library in my UWP v6.0.1 Project?


I have two .NET Core 2.0 projects and a Universal Windows Platform version v6.0.1 project (main) in my solution (both targets set to Build 16299). When any of the two .NET Core 2.0 projects, I get an error message "Unable to add a reference to project "xx". It would be nice if it told me why.

As a test, I added a new .NET Standard 2.0 library and I was able to reference it. From my limited understanding, .Net Standard 2.0 is compatible with .Net Core 2.0 which is the latest, so shouldn't .NET Core 2.0 also be compatible with UWP 6.0.1? When I look at the chart comparing .NET standards, it clearly states that .NET Standard 2.0 is and .NET Core 2.0 are compatible.

.Net Standard Versions

If all of this isn't amazingly confounding, the UWP project has the Microsoft .NETCore packages which list .NET Core 2.0:

UWP v6.0.1 Nuget Package  Description enter image description here

Also, although not shown, the UWP package has a .NETCore, Version 5.0 dependency! I was under the impression .NET Core is only at version 2.0:

enter image description here

What's going on here? Some clarification would be great.

ASIDE: Microsoft appears to be an incoherent organization as exhibited with this mindbogglingly confusing .NET architecture along with its scattered and disorganized documentation. It seems as if all the different departments are duplicating efforts with no higher level guidance. Perhaps, they need a .NET Czar.


Solution

  • .NET Core implements .NET Standard but it may have some APIs that are not available anywhere else. What you're saying is like saying "UWP implements .NET Standard so I could use UWP APIs in every .NET Standard project" and that's not true.

    .NET Standard is just a subset of APIs available on all the .NET platforms. It's a replacement for PCLs. You can use .NET Standard library in every .NET app/library that uses .NET that implements that certain version of .NET Standard.


    PS: Yeah, the relations between .NET Standard and others is kinda confusing. Also took me some time to understand it.