【问题标题】:how to use protobuf-net in the xamarin ios pcl如何在 xamarin ios pcl 中使用 protobuf-net
【发布时间】:2013-11-20 04:33:02
【问题描述】:

我正在尝试将 protobuf-net 与新的 xamarin ios pcl 一起使用,它的 nuget 数据包似乎不支持该框架。有没有办法将 protobuf-net 导入 pcl?

更新: 我刚刚发现使用新的 Xamarin PCL 定义重新编译 PCL 可以引用生成的库。干得好!当有新版本发布到 Nuget 时让我知道。

【问题讨论】:

    标签: ios xamarin protobuf-net


    【解决方案1】:

    NuGet 包包括 PCL 删除,但我不清楚你会让我在这里对 NuGet 包进行什么更改,因为我不知道具体的“Xamarin”目标; example targets are described here; protobuf-net 目前包含一个广泛的目标 portable-sl4+net40+wp7+windows8。如果您知道适用于 Xamarin for iOS 的目标(或确实是 PCL 构建组合),请告诉我。

    我还应该注意,NuGet drop 是“完整”实现,其中元编程是在运行时执行的。由于 iOS 中的限制,您可能会发现使用“CoreOnly”实现结合“预编译”工具可以获得更好的性能,该工具可从 google-code drop 获得。 This is described here.

    【讨论】:

    【解决方案2】:

    通过为我的可移植库手动编辑 .csproj 文件并设置目标框架配置文件以匹配 protobuf-net,我能够使用 NuGet 版本的 protobuf-net:

    <TargetFrameworkProfile>Profile136</TargetFrameworkProfile>
    

    生成的可移植库与 Xamarin.Android 配合良好。根据this list,它应该也适用于 Xamarin.iOS。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-02
      • 1970-01-01
      • 1970-01-01
      • 2015-03-01
      • 2023-04-10
      相关资源
      最近更新 更多