通过 nuget 将 NetMQ 安装到 xamarin 项目时出错

Error when installing NetMQ via nuget to xamarin projects

我尝试将 NetMQ 安装到我的 xamarin 应用程序中。

因为 NetMQ 依赖于 AsyncIO,所以无法安装这个包并显示以下错误:

Could not install package 'AsyncIO 0.1.18'. You are trying to install this 
package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111',
 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.

我该如何重新解决这个问题?

AsyncIO 0.1.18 NuGet 包和 NetMQ 3.3.3.1 NuGet 包仅包含 .NET 4.0 和 .NET 3.5 的程序集,因此您不能将其安装到可移植 class 库项目或 Xamarin 项目中.

您的选择包括:

  1. 将这些库移植到 Xamarin 框架。
  2. 仅在服务器端使用这些库。然后,您的 Xamarin 项目使用受支持的方式连接到您的服务器,例如通过 http.json 发送消息。
  3. 查找另一个支持 Xamarin 框架的库。

NetMQ 现在面向 Xamarin IOS 和 Android,您可以在这里下载:

https://www.nuget.org/packages/NetMQ/4.0.0.3-rc3