0
votes

I'm trying to add a Profile151 PCL nuget package to a Xamarin iOS and Android project in Visual Studio 2015 (Update 3) and it tells me that the package is not compatible. The package has the library folder "portable-net451-win81-wpa81" (which is the "official" recommendation for Profile151 PCL)

This is the error message: "Could not install package 'velox.core 1.0.2.8'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', 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."

The strange thing is that I can add the same nuget package to the project using Xamarin Studio.

What's the reason for this? Is there a workaround?

1
Just to make your question clear, you are adding the Profile151 PCL NuGet package to the actual PCL or the Xamarin.iOS/Xamarin.Android projects? Can you include a step-by-step replication for further investigation? (Or a sample project and which NuGet package you are trying to add).Jon Douglas
The problem I see is that there is no Xamarin.iOS10 target here. The only target is portable-net451-win81-wpa81. Meaning it will work in a PCL with those items, but not a Xamarin.iOS project. The error mentions this as well: Could not install package 'velox.core 1.0.2.8'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', 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. Seeing that it does indeed work in XS is another story.Jon Douglas
That doesn't make sense. A package with "portable-net45+netcore45+wpa81+wp8" does work fine, and that one doesn't have the Xamarin.iOS10 target either.Philippe Leybaert
It looks like this is a failure with the profile not being listed in the NuGet client's hard coded list: github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/… Thus why it fails on VS but not XS as XS is compatible via mono in a Xamarin.iOS.xml file in /Library/Frameworks/Mono.framework/Versions/4.4.2/lib/mono/xbuild-frameworks/.NETPortable/v4.6/Profile/Profile151/SupportedFrameworks I'm reporting a bug on the NuGet end as we speak and will follow up with an Answer on SO to track.Jon Douglas

1 Answers

2
votes

It looks like this is a failure on the NuGet Client side of things with regards to VS 2015. Ideally Profile151 should be marked as compatible with Xamarin.iOS, however it is not. This is because the hard coded list in NuGet v3 does not list Profile151:

https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Frameworks/DefaultPortableFrameworkMappings.cs#L112

I have thus reported an issue on the NuGet.Client github:

https://github.com/NuGet/Home/issues/3268