Search code examples
.netxamarinnugetportable-class-library

Updating nuget package to support xamarin unified


I am trying to get my pcl to build properly into a nuget package. I have updated to the xamarin beta and I have updated nuget to version 2.8.5 however I am getting the following error when creating my package:

Issue: Invalid framework folder.

Description: The folder 'Xamarin.iOS10' under 'lib' is not recognized as a valid framework name or a supported culture identifier.

Solution: Rename it to a valid framework name.

If I just use MonoTouch I don't get the error, nut then the nuget package is not installed correct.


Solution

  • I suspect you are not using the latest version of NuGet. The product version needs to be 2.8.3 or above. The assembly version will be 2.8.5.x which can be a bit confusing.

    If you are using NuGet.exe then run the following to check the product version:

    NuGet.exe update -self
    

    You should see the output:

    Checking for updates from https://www.nuget.org/api/v2/.
    Currently running NuGet.exe 2.8.3.
    NuGet.exe is up to date.
    

    Then run:

    NuGet.exe pack YourNuSpec.nuspec
    

    Also note that the invalid framework message is only a warning. The NuGet package will still be created with the correct lib directories even if you are using an old version of NuGet.exe which does not recognise the Xamarin.iOS framework.