Bug 34761 - NuGet PCL package fails to install/update
Summary: NuGet PCL package fails to install/update
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: NuGet ()
Version: 5.10 (C6SR3)
Hardware: PC Windows
: --- normal
Target Milestone: 5.10 (C6)
Assignee: Matt Ward
Depends on:
Reported: 2015-10-12 11:16 UTC by William
Modified: 2015-10-15 09:32 UTC (History)
0 users

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description William 2015-10-12 11:16:41 UTC

I tried to update one of my local NuGet packages in a PCL in Xamarin Studio and it fails with the following message:

Could not install package 'ibGib 0.6.329'. You are trying to install this package into a project that targets 'portable-net45+dnxcore50+win+MonoAndroid10+xamarinios10+MonoTouch10', 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.

I update/install it successfully in Visual Studio 2015 with the following output:

Attempting to gather dependencies information for package 'ibGib.0.6.329' with respect to project 'mobileGib.Common', targeting '.NETPortable,Version=v4.5,Profile=Profile7'
Attempting to resolve dependencies for package 'ibGib.0.6.329' with DependencyBehavior 'Lowest'
Resolving actions to install package 'ibGib.0.6.329'
Resolved actions to install package 'ibGib.0.6.329'
Package 'ibGib.0.6.329' already exists in folder 'E:\ib\mobileGib\Source\Android\mobileGib\packages'
Added package 'ibGib.0.6.329' to 'packages.config'
Successfully installed 'ibGib 0.6.329' to mobileGib.Common
========== Finished ==========

The other, non-PCL projects in my solution in Xamarin Studio updated it fine. They are all either Android Applications or Android Libraries. The only one that fails is the PCL (profile 7).

From my nuspec:
    <file src="..\Source\ibGib\bin\Release\ibGib.dll" target="lib\portable-net45+win+MonoAndroid10+MonoTouch10\ibGib.dll" />
Comment 1 Matt Ward 2015-10-12 12:07:48 UTC
This problem also affects Visual Studio 2013 - there is another bug #34520 with some discussion on how to fix the PCL profiles to get this working for VS 2013 which is will also fix Xamarin Studio, which I will summarize here in this comment.

There is also a discussion on the forum about this problem:


It looks like Visual Studio 2015 or ASP.NET 5 installs extra PCL profile .xml files which break Visual Studio 2013 and Xamarin Studio. The workaround is to remove these extra ASP.NET Core 5.0.xml files and restart Xamarin Studio. Taking the PCL profile 78 for example the ASP.NET Core 5.0.xml files will be in the directory:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile78\SupportedFrameworks

I would delete the ASP.NET Core 5.0.xml file from this directory. This will fix the PCL profile 78, which is the default for Xamarin.Forms. If you are using a different PCL profile you will need to remove the ASP.NET Core 5.0.xml file from the Profile259 directory.
Comment 2 William 2015-10-12 12:41:34 UTC
Thanks for pointing me to the thread, Matt. I skipped that one because it seemed to be related to Forms, which was a mistake (Mine is strictly Android). I've continued the discussion there.
Comment 3 Matt Ward 2015-10-15 08:25:36 UTC
It looks like one of the Microsoft teams introduced this new profile in VS 2015 update 1 or Windows Tools 1.1. There is a bug opened against NuGet for this problem. The NuGet team want the change reverted.

Comment 4 William 2015-10-15 09:32:04 UTC
Yep. That looks like the exact problem. Great find.