msgpack / msgpack-cli

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

.NET Core 2.0 supported? #277

Closed kieran154 closed 6 years ago

kieran154 commented 6 years ago

I have a .NET Core 2.0 application using VS2017 and I'm trying to use MsgPack but I'm getting this error

System.TypeInitializationException occurred HResult=0x80131534 Message=The type initializer for 'MsgPack.Serialization.EmittingSerializers.SerializationMethodGeneratorManager' threw an exception. Source=<Cannot evaluate the exception source> StackTrace: at MsgPack.Serialization.EmittingSerializers.SerializationMethodGeneratorManager.Get(SerializationMethodGeneratorOption option) at MsgPack.Serialization.EmittingSerializers.AssemblyBuilderSerializerBuilder.<>c__DisplayClass63_0.<CreateCodeGenerationContextForSerializerCreation>b__1() at MsgPack.Serialization.EmittingSerializers.AssemblyBuilderEmittingContext.get_Emitter() at MsgPack.Serialization.EmittingSerializers.AssemblyBuilderEmittingContext.BeginMethodOverride(String name) at MsgPack.Serialization.AbstractSerializers.SerializerBuilder2.BuildObjectPackTo(TContext context, SerializationTarget targetInfo, Boolean isAsync) at MsgPack.Serialization.AbstractSerializers.SerializerBuilder2.BuildObjectSerializer(TContext context) at MsgPack.Serialization.AbstractSerializers.SerializerBuilder2.BuildSerializer(TContext context, Type concreteType, PolymorphismSchema schema, SerializationTarget& targetInfo) at MsgPack.Serialization.AbstractSerializers.SerializerBuilder2.BuildSerializerInstance(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 MPLibrary.src.transport.impl.MsgPackSerializer1.MPLibrary.src.transport.IDataSerializer.serialize(T data) in F:\Uni\University\Third\MULTIPLAYER\MPLibrary\MPLibrary\src\transport\serialization\impl\MsgPackSerializer.cs:line 27 at MPServer.Program.Main(String[] args) in F:\Uni\University\Third\MULTIPLAYER\MPServer\MPServer\Program.cs:line 26

Inner Exception 1: MissingMethodException: Method not found: 'System.Reflection.Emit.AssemblyBuilder System.AppDomain.DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess)'. `

I have tried the exact same code using VS2015 and a .NET 4.5 application and it works fine. Am I missing something?

kieran154 commented 6 years ago

I believe I was using a wrong build. I pulled it down from NuGet and it's working.