Skip to content

portable-net45+sl5+win8+wpa81+wp8 and xamarinmac20 #4454

@tofutim

Description

@tofutim

Please read the following information before posting the issue.

Details about Problem

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): Xamarin Studio

NuGet version (x.x.x.xxx): 3.5

OS version (i.e. win10 v1607 (14393.321)): OSX

Worked before? If so, with which NuGet version: 2

Detailed repro steps so we can see the same problem

(Hoping in here from https://forums.xamarin.com/discussion/comment/249677#Comment_249677)

  1. Create a new Xamarin Mac Unified project

  2. Try installing Microsoft.AspNet.SignalR.Client, it will fail because 'portable-net45+sl5+win8+wpa81+wp8' is not recognized as valid for xamarinmac20.

Retrieving package 'Microsoft.AspNet.SignalR.Client 2.2.1' from 'nuget.org'.
For adding package 'Microsoft.AspNet.SignalR.Client.2.2.1' to project 'Eggs' that targets 'xamarinmac20'.
Install failed. Rolling back...
Package 'Microsoft.AspNet.SignalR.Client.2.2.1' does not exist in project 'Eggs'
Package 'Microsoft.AspNet.SignalR.Client.2.2.1' does not exist in folder '/Users/tim/Projects/Eggs/packages'
Executing nuget actions took 147.87 ms
Could not install package 'Microsoft.AspNet.SignalR.Client 2.2.1'. You are trying to install this package into a project that targets 'Xamarin.Mac,Version=v2.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 problem is apparently in https://github.com/NuGet/NuGet.Client/blob/4cccb13833ad29d6a0bcff055460d964f1b49cfe/src/NuGet.Core/NuGet.Frameworks/DefaultPortableFrameworkMappings.cs#L125-L130 where the Xamarin framework PCL compatibility is hardcoded. Here Xamarin Mac is missing and since Xamarin Studio uses nuget 3.x, sadness. Note that if a package targets netstandard1.1 it does work.

                    var monoandroid = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.MonoAndroid, new Version(0, 0));
                    var monotouch = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.MonoTouch, new Version(0, 0));
                    var xamarinIOs = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.XamarinIOs, new Version(0, 0));
                    var xamarinTVOS = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.XamarinTVOS, new Version(0, 0));
                    var xamarinWatchOS = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.XamarinWatchOS, new Version(0, 0));
                    var monoFrameworks = new NuGetFramework[] { monoandroid, monotouch, xamarinIOs, xamarinWatchOS, xamarinTVOS };

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions