I have a PCL that targets the following platforms:

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

I also have another package (called Enu), based off .NET Core and project.json, that I would like to use in this PCL. My problem is, when I try to install the .NET Core package into my PCL, I receive an error message saying that the PCL isn't 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.

After digging into the issue for a bit, I found out that a package Enu depends on, specifically System.Runtime (v4.0.0), appeared to be having issues as well (related post) installing on my PCL. The strange thing is, while it claims to be incompatible with my library, it supports all of the target platforms I do, so I don't see why this is the case.

TL;DR: NuGet won't allow a .NET Core package to be installed on PCL because it thinks they're incompatible. After investigating, I found out the root of the problem was a dependency of the package was incompatible with the PCL, even though it supports all of the platforms my PCL does. Why is this happening?

Here's the project.json file for the .NET Core package, am I doing anything wrong?

Related posts

Recent Viewed