File Not Found Exception in easyNetQ package for .net core
See original GitHub issueGetting exception in .net core console application whiling receiving the published event from the queue. receiver throws following in error queue. but same code works charm in .net framework 4.6.2.
{“RoutingKey”:“ha.TestMessagesQueue”,“Exchange”:“”,“Queue”:“ha.TestMessagesQueue”,“Exception”:“System.AggregateException: One or more errors occurred. (Could not load file or assembly ‘Publisher, Culture=neutral, PublicKeyToken=null’. The system cannot find the file specified.) —> System.IO.FileNotFoundException: Could not load file or assembly ‘Publisher, Culture=neutral, PublicKeyToken=null’. The system cannot find the file specified.\r\n at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, IntPtr ptrLoadContextBinder)\r\n at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, IntPtr ptrLoadContextBinder)\r\n at System.Reflection.Assembly.Load(AssemblyName assemblyRef)\r\n at EasyNetQ.DefaultTypeNameSerializer.GetTypeFromTypeNameKey(TypeNameKey typeNameKey)\r\n at EasyNetQ.DefaultTypeNameSerializer.<>c.<DeSerialize>b__3_0(String t)\r\n at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func
2 valueFactory)\r\n at EasyNetQ.DefaultMessageSerializationStrategy.DeserializeMessage(MessageProperties properties, Byte[] body)\r\n at EasyNetQ.RabbitAdvancedBus.<>c__DisplayClass17_0.<Consume>b__0(Byte[] body, MessageProperties properties, MessageReceivedInfo messageReceivedInfo)\r\n at EasyNetQ.RabbitAdvancedBus.<>c__DisplayClass21_0.<Consume>b__0(Byte[] body, MessageProperties properties, MessageReceivedInfo receivedInfo)\r\n at EasyNetQ.Consumer.HandlerRunner.InvokeUserMessageHandler(ConsumerExecutionContext context)\r\n — End of inner exception stack trace —\r\n—> (Inner Exception #0) System.IO.FileNotFoundException: Could not load file or assembly ‘Publisher, Culture=neutral, PublicKeyToken=null’. The system cannot find the file specified.\r\nFile name: ‘Publisher, Culture=neutral, PublicKeyToken=null’\r\n at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, IntPtr ptrLoadContextBinder)\r\n at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, IntPtr ptrLoadContextBinder)\r\n at System.Reflection.Assembly.Load(AssemblyName assemblyRef)\r\n at EasyNetQ.DefaultTypeNameSerializer.GetTypeFromTypeNameKey(TypeNameKey typeNameKey)\r\n at EasyNetQ.DefaultTypeNameSerializer.<>c.<DeSerialize>b__3_0(String t)\r\n at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func
2 valueFactory)\r\n at EasyNetQ.DefaultMessageSerializationStrategy.DeserializeMessage(MessageProperties properties, Byte[] body)\r\n at EasyNetQ.RabbitAdvancedBus.<>c__DisplayClass17_0.<Consume>b__0(Byte[] body, MessageProperties properties, MessageReceivedInfo messageReceivedInfo)\r\n at EasyNetQ.RabbitAdvancedBus.<>c__DisplayClass21_0.<Consume>b__0(Byte[] body, MessageProperties properties, MessageReceivedInfo receivedInfo)\r\n at EasyNetQ.Consumer.HandlerRunner.InvokeUserMessageHandler(ConsumerExecutionContext context)\r\n\r\n<—\r\n”,“Message”:“{"Text":"bfca66fd-6e34-44bd-8d1d-33965031d3c6","datetime":"2018-07-11T05:45:10.2311123Z"}”,“DateTime”:“2018-07-11T05:45:10.2420497Z”,“BasicProperties”:{“ContentType”:null,“ContentEncoding”:null,“Headers”:{},“DeliveryMode”:0,“Priority”:0,“CorrelationId”:“6980b1a6-f4e6-4301-a9b0-778aabdabe5a”,“ReplyTo”:null,“Expiration”:null,“MessageId”:null,“Timestamp”:0,“Type”:“Publisher.TestMessage, Publisher”,“UserId”:null,“AppId”:null,“ClusterId”:null,“ContentTypePresent”:false,“ContentEncodingPresent”:false,“HeadersPresent”:true,“DeliveryModePresent”:false,“PriorityPresent”:false,“CorrelationIdPresent”:true,“ReplyToPresent”:false,“ExpirationPresent”:false,“MessageIdPresent”:false,“TimestampPresent”:false,“TypePresent”:true,“UserIdPresent”:false,“AppIdPresent”:false,“ClusterIdPresent”:false}}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:10 (4 by maintainers)
Top GitHub Comments
I have two console application one publishes the event and other receives it from the queue.
As of now, we been consuming with the Custom Object type {{message}} which is local to the each application.
While doing so, unable to retrieve the message. while i tried to keep the message in separate class library project and refer in both sender and receiver, I could able to retrieve the message.
I have attached the sample POC EasyQTestCore.zip depicting the scenario. Looking forward your expert advice.
I hope that previous error is generic scenario which was fixed and now, ended up with this issue.
Got it, thanks @Pliner!