-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception when calling MessagePackSerializer.Get<T> in SL5 #205
Comments
Thank you for reporting! |
Sure. It's in the callback handler of a web request. What's interesting though, is that we have version 0.4 in production code and it works fine. I literally updated the package version and changed the line of invocation from .Create to .Get. That's it. By the way, I also tried with version 0.6, and I get a bit more detail with my exceptions. It first throws on one of my custom types (a custom Date class), but it will also throw on something like TimeSpan. Again, with no changes on the backend in the data class which worked fine with the older version. |
Thank you for interesting information. I fixed a lot for Xamarin and Unity support in 0.5, it may affect something. I will investigate it. |
P/Invoke causes verification error in Windows Native. It gains performance for edge case -- comparing (relatively) large blob (not string). It is clearly rare, and it may bring packaging issue in future. In addition, it is not so bad naive managed loop. In best (or worst) case, it only 1.8x slower than memcmp. Although it is 12x slower when it is well aligned bytes, but it should be rare in real world. So, memcmp has gone.
I confirmed that this issue is caused by code access security. I'm fixing this issue. |
Ok, cool. Please let me know if there's anything I can do to help test it. |
When will this fix be available in any version? Also in 0.8.2? Thanks! |
0.9.0. I'm fixing #202 now, and then I will release rc. |
When calling MessagePackSerializer.Get in SL5 (where T is some complex object) I get the following exception
Attempt by method 'MsgPack.Serialization.ReflectionExtensions.CreateInstancePreservingExceptionType(System.Type, System.Object[])' to access method 'MsgPack.Serialization.DefaultSerializers.GenericSerializer+ListInstanceFactory`1<System.__Canon>..ctor()' failed.
I'm using version 0.8.0. Any pointer as to what this means?
My stack trace is:
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at MsgPack.Serialization.ReflectionExtensions.CreateInstancePreservingExceptionType(Type type, Object[] constructorParameters)
at MsgPack.Serialization.DefaultSerializers.GenericSerializer.CreateListSerializer(SerializationContext context, Type itemType, PolymorphismSchema schema)
at MsgPack.Serialization.DefaultSerializers.GenericSerializer.Create(SerializationContext context, Type targetType, PolymorphismSchema schema)
at MsgPack.Serialization.DefaultSerializers.GenericSerializer.Create[T](SerializationContext context, PolymorphismSchema schema)
at MsgPack.Serialization.SerializationContext.GetSerializer[T](Object providerParameter)
at MsgPack.Serialization.SerializationContext.SerializerGetter
1.Get(SerializationContext context, Object providerParameter) at MsgPack.Serialization.SerializationContext.SerializerGetter.Get(SerializationContext context, Type targetType, Object providerParameter) at MsgPack.Serialization.SerializationContext.GetSerializer(Type targetType, Object providerParameter) at MsgPack.Serialization.ReflectionSerializers.ReflectionSerializerHelper.GetMetadata(Type targetType, IList
1 members, SerializationContext context, Func2[]& getters, Action
2[]& setters, MemberInfo[]& memberInfos, DataMemberContract[]& contracts, MessagePackSerializer[]& serializers)at MsgPack.Serialization.ReflectionSerializers.ReflectionObjectMessagePackSerializer
1..ctor(SerializationContext context) at MsgPack.Serialization.MessagePackSerializer.CreateReflectionInternal[T](SerializationContext context, Type concreteType, PolymorphismSchema schema) at MsgPack.Serialization.MessagePackSerializer.CreateInternal[T](SerializationContext context, PolymorphismSchema schema) at MsgPack.Serialization.SerializationContext.GetSerializer[T](Object providerParameter) at MsgPack.Serialization.SerializationContext.SerializerGetter
1.Get(SerializationContext context, Object providerParameter)at MsgPack.Serialization.SerializationContext.SerializerGetter.Get(SerializationContext context, Type targetType, Object providerParameter)
at MsgPack.Serialization.SerializationContext.GetSerializer(Type targetType, Object providerParameter)
at MsgPack.Serialization.ReflectionSerializers.ReflectionSerializerHelper.GetMetadata(Type targetType, IList
1 members, SerializationContext context, Func
2[]& getters, Action2[]& setters, MemberInfo[]& memberInfos, DataMemberContract[]& contracts, MessagePackSerializer[]& serializers) at MsgPack.Serialization.ReflectionSerializers.ReflectionObjectMessagePackSerializer
1..ctor(SerializationContext context)at MsgPack.Serialization.MessagePackSerializer.CreateReflectionInternal[T](SerializationContext context, Type concreteType, PolymorphismSchema schema)
at MsgPack.Serialization.MessagePackSerializer.CreateInternal[T](SerializationContext context, PolymorphismSchema schema)
at MsgPack.Serialization.SerializationContext.GetSerializer[T](Object providerParameter)
at MsgPack.Serialization.MessagePackSerializer.Get[T](SerializationContext context, Object providerParameter)
at MsgPack.Serialization.MessagePackSerializer.Get[T](SerializationContext context)
at MsgPack.Serialization.MessagePackSerializer.GetT
The text was updated successfully, but these errors were encountered: