NuGet and Portable Class Libraries - The package is not intended for any frameworks

I have been using NuGet to manage my internally created builds for several months, and it works very well. I recently discovered "portable class libraries" that were also great until it was time to install the packages.

Say I have a PCL that is for .NET 4.5, SL5, and .NET for Windows Store apps. I run nuget spec to create a .nuspec file, edit the values, pack it and add .nupkg to our internal channel. If I open the .nupkg file in Package Explorer, I see one content folder under lib called portable-win + net45 + sl50.

When I try to install a package from any compatible project into another solution, I get the following message:

"Project.PCL" cannot be installed because it is not compatible with any project in the solution. The package is not intended for any frameworks. "

If I manually create .nupkg in Package Explorer, updating the version number, adding the lib folder for each target infrastructure (and not the portable folder) and adding the Project.PCL.dll file to each folder, I can add a package for compatible projects in the solution. But for this process, every time I want to update PCl, it's a little tedious (I created a small .cmd file in the project root folder to quickly pack and deploy).

Do other people have this problem? How can I pack PCL in the same way as other types of projects?

Note. I am using VS 2012 Ultimate and NuGet 2.2

+4
source share
2 answers

It seems that perhaps the nuget spec does not work in portable class libraries - it is worth starting a thread or reporting a problem on the NuGet website .

However, you can also create a .nuspec file from NuGet Package Explorer. Just create the package as you already did, but then select "Save metadata as ..." to save it as .nuspec. Subsequently, you may need to manually edit the source paths in the nuspec file, but you should be able to automate the creation of the package.

+2
source

For me, nuget spec and nuget pack worked great with a portable project when creating a package and installing it on a compatible project.
You want to check if you have the latest nuget.exe (2.2), you can download it from http://nuget.org/nuget.exe or you can update it by doing nuget update -self

+1
source

All Articles