Skip to content

TypeInitializationException from MessagePackSerializer.Get<IList<MessagePackObjectDictionary>>() #64

@benjamin-bader

Description

@benjamin-bader

This happens on Windows Phone 8.1, in a WinRT project (not Silverlight), as a result of a security-critical method call:

{System.MethodAccessException: Attempt by security transparent method 'MsgPack.Serialization.SerializationContext..ctor(MsgPack.Serialization.SerializerRepository, MsgPack.PackerCompatibilityOptions)' to access security critical method 'System.Collections.Concurrent.ConcurrentDictionary`2<System.__Canon,System.__Canon>..ctor()' failed.
   at MsgPack.Serialization.SerializationContext..ctor(SerializerRepository serializers, PackerCompatibilityOptions packerCompatibilityOptions)
   at MsgPack.Serialization.SerializationContext..ctor(SerializerRepository allwaysNull)
   at MsgPack.Serialization.SerializationContext..cctor()}

The code that produces this exception is, in its entirety:

private byte[] Serialize(IList<MessagePackObjectDictionary> syncInfo)
{
    return MessagePackSerializer
        .Get<IList<MessagePackObjectDictionary>>()
        .PackSingleObject(syncInfo);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugDetected as bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions