Why is this .NET Core package not compatible with my PCL?

I have a PCL that is designed for the following platforms:

  • .NET Framework 4.5
  • Windows 8
  • Windows Phone 8.1

I also have another package (called Enu ) based on .NET Core and project.jsonwhich I would like to use in this PCL. My problem is that when I try to install the .NET Core package in my PCL, I get an error message saying that the PCL is not compatible with the package.

PM> Install-Package Enu
# lots of output...
Install failed. Rolling back...
Package 'Enu 4.4.0' does not exist in project 'PclDummy'
Package 'Enu 4.4.0' does not exist in folder 'C:\Users\James\Documents\Visual Studio 2015\Projects\PclDummy\packages'
Install-Package : Could not install package 'Enu 4.4.0'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111', but the package does not contain 
any assembly references or content files that are compatible with that framework. For more information, contact the package author.

, , , Enu , , System.Runtime (v4.0.0), , ( ) PCL. , , , , , .


TL; DR: NuGet .NET Core PCL, , . , , PCL, PCL . ?

project.json .NET Core, - ?

+4
3

, , , (FINALLY) . , project.json:

{
    ...

    "frameworks": {
        "dotnet": {
            "dependencies": {
                "System.Runtime": "4.0.20"
            }
        },
        ".NETPortable,Version=v4.5,Profile=Profile111": {
            "frameworkAssemblies": {
                "System.Runtime": ""
            }
        }
    }
}

, , .

+2

, , , PCL, .NET 4.5, Windows 8 Windows Phone 8.1, PCL, API, . , Enu API, .NET 4.5, Windows 8 / Windows Phone 8.1.

.NET Core, .NET 4.5 Enu, PCL, (.NET 4.5, Windows 8, Windows Phone 8.1) .NET API (.NET 4.5, Windows 8, Windows Phone 8.1 , , Windows Phone 8 Silverlight).

EDIT: NuGet, , , .NET 4.5, Windows 8 Windows Phone 8.1, , PCL - , . NuGet "portable-net45 + win + wpa81".

+5

dotnet . json Windows 8 Windows Phone 8.1. netcore45 wpa81 .

+2

Source: https://habr.com/ru/post/1609386/


All Articles