Masstransit: QuickStart sample doesn't run correctly on .Net Core 2.0

Created on 12 Oct 2017  路  1Comment  路  Source: MassTransit/MassTransit

Is this a bug report?

Yes

Can you also reproduce the problem with the lastest version?

Yes

MassTransit 3.5.7
RabbitMQ 3.6.12
Erlang 20.1

Environment

Windows 7
VS 2017
.NET Core 2.0

Steps to Reproduce

  1. Install RabbitMQ
  2. Create 'QuickStart' console app (.NET Core) using code from http://masstransit-project.com/MassTransit/quickstart.html
  3. Install NuGet packages for MassTransit and MassTransit.RabbitMQ
  4. Run app

Expected Behavior

I expect the following console message to appear: Received: Hi

Actual Behavior

Instead, the following console message appeared: MOVE rabbitmq://localhost/test_queue N/A rabbitmq://localhost/test_queue_error?bind=true&queue=test_queue_error Fault: Method not found: 'System.Reflection.Emit.AssemblyBuilder System.AppDomain.DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess)'.

From the RabbitMQ Management tool, I was able to retrieve the following:

The Full exception message and stack trace:

Method not found: 'System.Reflection.Emit.AssemblyBuilder System.AppDomain.DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess)'.
--
at GreenPipes.Internals.Reflection.DynamicImplementationBuilder.<>c__DisplayClass10_0`1.<GetModuleBuilderForType>b__0(String name)聽
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at GreenPipes.Internals.Reflection.DynamicImplementationBuilder.GetModuleBuilderForType[TResult](Type interfaceType, Func`2 callback)聽at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)聽at System.Lazy`1.CreateValue()
at MassTransit.Serialization.JsonConverters.InterfaceProxyConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)聽at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader)
at MassTransit.Serialization.JsonMessageDeserializer.MassTransit.IMessageDeserializer.Deserialize(ReceiveContext receiveContext)

The sample message payload:

{
  "messageId": "7fb00000-7ec0-484d-59ea-08d511039bd3",
  "conversationId": "7fb00000-7ec0-484d-c23a-08d511039bd4",
  "sourceAddress": "rabbitmq://localhost/bus-ANROCS-JWILSON-dotnet-x6ayyyd6abrr5irxbdktnyh5dm?durable=false&autodelete=true",
  "destinationAddress": "rabbitmq://localhost/QuickStart:YourMessage",
  "messageType": [
    "urn:message:QuickStart:YourMessage"
  ],
  "message": {
    "text": "Hi"
  },
  "headers": {},
  "host": {
    "machineName": "ANROCS-JWILSON",
    "processName": "dotnet",
    "processId": 66048,
    "assembly": "QuickStart",
    "assemblyVersion": "1.0.0.0",
    "frameworkVersion": "4.0.30319.42000",
    "massTransitVersion": "3.5.7.1082",
    "operatingSystemVersion": "Microsoft Windows NT 6.2.9200.0"
  }
}

Dependency warnings:

image

Reproducible Demo

See Steps to Reproduce, above.

Most helpful comment

Masstransit 3.5.7 isn't compatible with net core 2.0
You need to use the pre-release version 4.0.0.1320-develop

>All comments

Masstransit 3.5.7 isn't compatible with net core 2.0
You need to use the pre-release version 4.0.0.1320-develop

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fshchudlo picture fshchudlo  路  4Comments

phatboyg picture phatboyg  路  6Comments

mia01 picture mia01  路  6Comments

slaneyrw picture slaneyrw  路  6Comments

gschuager picture gschuager  路  7Comments