msgpack / msgpack-cli

MessagePack implementation for Common Language Infrastructure / msgpack.org[C#]
http://msgpack.org
Apache License 2.0
835 stars 175 forks source link

Error in Unity WebGL build #196

Open endel opened 8 years ago

endel commented 8 years ago

Hey there,

First of all, thanks for this awesome library.

I'm importing the binary unity (not unity-full, version 0.9.0-beta1) and building for the web and here's the error that I get:

Attempting to call method 'MsgPack.Serialization.SerializationContext::GetSerializer' for which no ahead of time (AOT) code was generated.
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.

Is this error expected? I see that @tametick had a similar issue, but I'm not sure if it's the same.

Cheers!

yfakariya commented 8 years ago

Sorry for delay. It should be same (AOT issue) which is caused by missing MessagePackSerialiazer.PrepareType<T>() call for required types...

Please try to call PrepareType<T> for you want to (de)serialize and its dependencies.

It should be more accurate when you put the full stack trace if available.