How to make a NuGet package for this PCL library

I am trying to create a nuget package for the PCL library I created.

This nuget package is intended for use in the Xamarin Forms application . So I'm not even sure that everything that I noted is true.

I really only care about the .NET Framework 4. This is my minimal framework. Otherwise, I do not care, and I have no idea what I should focus on.

Whatever the cost, I use the NuGet Package Explorer to create my NuGet nupkg files, to manually verify them before publishing to NuGet.

Here is a screenshot of what I tried, but Xamarin Studio was unable to add the nuget package (saying that this is something not what you need).

enter image description here

and an error message from Xam Studio:

 Adding Foo... Adding 'Foo 1.3.0' to Core. Could not install package 'Foo 1.3.0'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10', 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. 
+4
source share
1 answer

For Xamarin.Forms, two profiles that are good for your Portable Class Library (PCL) project to use are Profile 78 or Profile 259. Xamarin.Forms can be used in other profiles, but if your PCL project targets one of these you should be in order. Your project will target profile 78.

Here are the PCL profiles for Xamarin.Forms.

Xamarin.Forms 1.3:

 portable-win+net45+wp80+MonoAndroid10+MonoTouch10 

Xamarin.Forms 1.4:

 portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10 

The problem with your NuGet package is that it does not indicate that it supports Windows 8 in PCL. NuGet will consider all the individual structures that make up the PCL profile of the project (ignoring Xamarin and Mono, as they are optional if you do not have them in your PCL profile of the NuGet package) and make sure that the PCL profile for the NuGet package has a structure that is compatible. If the NuGet PCL does not have an appropriate structure, then NuGet considers this incompatible.

So your portable NuGet library folder should include win

 portable-net4+sl5+wp8+win 

You can then install your NuGet package into your PCL Profile 78 project.

+3
source

All Articles