Skip to content
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

System.TypeLoadException in Unity #319

Open
teremyx opened this issue Mar 6, 2019 · 0 comments
Open

System.TypeLoadException in Unity #319

teremyx opened this issue Mar 6, 2019 · 0 comments

Comments

@teremyx
Copy link

teremyx commented Mar 6, 2019

Hi.
I'm using MessagePack in Unity (not using IL2CPP) and also in a standalone c# application (a master server, that sends and receives objects from the (Unity-)client).

Somehow I get this error when trying to serialize an object of class "ClientSetupRequest":
System.TypeLoadException: Could not load type 'MessagePack.Formatters.ClientSetupRequestFormatter1' from assembly ''. at MessagePack.FormatterResolverExtensions.GetFormatterWithVerify[T] (MessagePack.IFormatterResolver resolver) [0x0001b] in <9584f10ef1c54d659bd9587a0a564bad>:0 at MessagePack.MessagePackSerializer.Serialize[T] (T obj, MessagePack.IFormatterResolver resolver) [0x0000a] in <9584f10ef1c54d659bd9587a0a564bad>:0 at MessagePack.MessagePackSerializer.Serialize[T] (T obj) [0x00000] in <9584f10ef1c54d659bd9587a0a564bad>:0 at (wrapper dynamic-method) System.Object.lambda_method(System.Runtime.CompilerServices.Closure,object) at MessagePack.MessagePackSerializer+NonGeneric.Serialize (System.Type type, System.Object obj) [0x00006] in <9584f10ef1c54d659bd9587a0a564bad>:0 at...

The ClientSetupRequest class looks like this:
`using MessagePack;

[MessagePackObject]
public class ClientSetupRequest : GameNetworkEvent
{

[Key(0)]
public string PlayerName;

}
`

The GameNetworkEvent class is just an empty class.

I'm not sure but I think something the exception doesn't occur for some reason...

What's strange is that it says:

from assembly ''.

So the assembly is empty?

I don't know which version I was using before, but I just redownloaded MessagePack (version 1.7.3.4 using nuget) and copied the .dll from the net47 folder to my Unity Project and also referencing it from my standalone c# app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant