简体   繁体   中英

How to add nuget package in Xamarin studio

I am completely new to xamarin studio. I am trying to add a nuget package. using the add packages dialogue appears to be working however I get an error:

  Attempting to gather dependency information for package 'SidebarNavigation.1.9.0.3' with respect to project 'helloios', targeting '.NETPortable,Version=v4.0,Profile=Profile344'
Attempting to resolve dependencies for package 'SidebarNavigation.1.9.0.3' with DependencyBehavior 'Lowest'
Resolving actions to install package 'SidebarNavigation.1.9.0.3'
Resolved actions to install package 'SidebarNavigation.1.9.0.3'
For adding package 'SidebarNavigation.1.9.0.3' to project 'helloios' that targets 'portable40-net45+sl5+win8+wp8+wpa81'.
Install failed. Rolling back...
Package 'SidebarNavigation.1.9.0.3' does not exist in project 'helloios'
Package 'SidebarNavigation.1.9.0.3' does not exist in folder '/Users/********/Projects/helloios/packages'
Could not install package 'SidebarNavigation 1.9.0.3'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.0,Profile=Profile344', 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.

This is the github page for the package.

https://github.com/jdehlin/Xamarin-Sidebar

I tried to use different PCL profiles to no effect. I'm not sure how to determine which profile should be used.

The package targets only "Xamarin.iOS". You can't reference it in a PCL that targets more than that, since any other platform wouldn't be able to use it.

Either don't use a PCL, or restrict the PCL to "Xamarin.iOS".

Since this seems to be a UI component, you should reference it from your main project instead, and maybe expose some functionality through services to the PCL, if needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM