Skip to content

The type initializer for 'FormatterCache`1' threw an exception. #187

@Jericho

Description

@Jericho

I just upgraded to 1.7.3 and one of my unit tests that is validating my serialization logic is failing.

Here's how I try to serialize a message:

private byte[] Serialize<T>(T message)
{
    // If target binary size under 64 bytes, LZ4MessagePackSerializer does not compress to optimize small size serialization.
    return LZ4MessagePackSerializer.Typeless.Serialize(message);
}

Information about the exception:

System.AggregateException
  HResult=0x80131500
  Message=One or more errors occurred. (Exception has been thrown by the target of an invocation.)
  Source=System.Private.CoreLib
  StackTrace:
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at Picton.Managers.UnitTests.QueueMangerTests.AddMessageAsync_large_message() in E:\_build\Picton\Source\Picton.UnitTests\Managers\QueueManagerTests.cs:line 189

Inner Exception 1:
TargetInvocationException: Exception has been thrown by the target of an invocation.

Inner Exception 2:
TypeInitializationException: The type initializer for 'FormatterCache`1' threw an exception.

Inner Exception 3:
TypeInitializationException: The type initializer for 'FormatterCache`1' threw an exception.

Inner Exception 4:
TypeLoadException: Type 'MessagePack.Formatters.Picton_LargeMessageEnvelopeFormatter1' from assembly 'MessagePack.Resolvers.DynamicContractlessObjectResolver, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is attempting to implement an inaccessible interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions