我正在使用 protobuf-net v2 beta r450(二进制发行版)并使用此处描述的技术提前构建序列化程序集:
http://www.frictionpointstudios.com/blog/2011/3/31/using-protobuf-net-serialization-in-unity-iphone.html
我在 Windows 上创建序列化程序集并在 MonoTouch 项目中使用它。它在模拟器下工作。但是,当在仅强制执行 AOT 编译的设备上运行时,我收到此错误:
attempting to JIT compile method 'ProtoBuf.BufferPool.GetBuffer()'
while running with --aot-only
调用 Serialize() 时会出现异常:
using (var stream = File.Create(out_file))
{
serializer.Serialize(stream, settings);
}
谢谢你的帮助。
我获取了 protobuf-net 源代码(v2 r470)。使用 [ImmutableObject] 确实是问题之一。我通过 protobuf-net 问题列表向 @MarcGravell 提交了一些小补丁。我已经更新了我的示例http://github.com/t9mike/ProtoBuf1有了这个新的组件。感谢大家的回复。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)