C# Mono aot with protobuf-net getting ExecutionEngineException -
first big marc gravell author of protobuf-net http://code.google.com/p/protobuf-net/ . it's great resource. anyhow hoping marc or else can me resolve exception.
i trying implement protobuf-net on mobile devices (ios , android) using unity3d game engine. unity 3.2 uses mono 2.6, modified version of mono.
it works fine in editor, on ios device @ runtime fails @ first member tries serialize. note --aot-only flag in exception. think unity builds arm assembly through mono's aot feature though don't understand it's doing under hood.
executionengineexception: attempting jit compile method 'protobuf.property.property`2<gamemanagersavestate , bool>:.ctor ()' while running --aot-only. @ protobuf.property.propertyboolean`1[gamemanagersavestate]..ctor () [0x00000] in <filename unknown>:0 @ protobuf.property.propertyfactory.createproperty[gamemanagersavestate] (system.type type, protobuf.dataformat& format, memberserializationoptions options) [0x00000] in <filename unknown>:0 @ protobuf.property.propertyfactory.create[gamemanagersavestate] (system.reflection.memberinfo member) [0x00000] in <filename unknown>:0 @ protobuf.serializer`1[gamemanagersavestate].build () [0x00000] in <filename unknown>:0
it suggested on irc declare variables of these types ahead of time, compiler not have jit them @ runtime. seems great idea, unfortunately these internal generic types, , don't know write in c# declare variables in order fake out compiler. can interpret above message , let me know compiler needs know in advance? other strategies preventing happening? btw here top of class it's erroring
using unityengine; using system; using system.collections; using system.collections.generic; using protobuf; [protocontract] public class gamemanagersavestate { [protomember(1)] public bool gameover; // snip
thanks mono , protobuf experts helping me nail one! protobuf-net seems awesome , lightweight serialization , rpc wire protocol perfect ios , android apps, looking forward using it.
there number of issues in v1 make bit of pain pre-jit; v2, although incomplete, intended resolve many/all of these issues, not least offering pre-compile dll option - runtime-only version should much more device friendly.
i should mention jon's port of java version should work here, since compiler-heavy rather runtime-heavy.
Comments
Post a Comment