I'm creating a NuGet package using one of those new "Class Library (Package)" templates in VS. I want to know, is there any way I can use my package from a PCL that does not use .NET Core?
For example, I have a package, Enu
, with the following project.json
:
{
"title": "Enu",
// project details...
"dependencies": {
"System.Runtime": "4.0.0"
},
"frameworks": {
"dotnet": { }
}
}
Then I have a legacy PCL that targets .NET 4.5, Windows 8, and Windows 8.1. When I try to install the package via Install-Package Enu
, I get the following error:
PM> Install-Package Enu
# blah blah blah
Install-Package : Could not install package 'Enu 4.0.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.
What can I do to fix this?
note: Weirdly enough, it works on a console application.