简体   繁体   English

如何在Xamarin Studio中添加nuget包

[英]How to add nuget package in Xamarin studio

I am completely new to xamarin studio. 我对Xamarin Studio完全陌生。 I am trying to add a nuget package. 我正在尝试添加一个nuget包。 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. 这是该软件包的github页面。

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

I tried to use different PCL profiles to no effect. 我尝试使用其他PCL配置文件无效。 I'm not sure how to determine which profile should be used. 我不确定如何确定应使用哪个配置文件。

The package targets only "Xamarin.iOS". 该软件包仅针对“ 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. 您不能在目标更多的PCL中引用它,因为任何其他平台都无法使用它。

Either don't use a PCL, or restrict the PCL to "Xamarin.iOS". 不要使用PCL,或者将PCL限制为“ 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. 由于这似乎是一个UI组件,因此您应该从主项目中引用它,并在需要时通过PCL的服务公开某些功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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