question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

File Not Found Exception in easyNetQ package for .net core

See original GitHub issue

Getting 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, Func2 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, Func2 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
josephjoychristophercommented, Jul 12, 2018

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.

1reaction
nicolassimoncinicommented, Jun 11, 2020

Got it, thanks @Pliner!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dependency hell and file not found exception with ...
It means that dependency management in .NET Core 2.0 is not working correctly under certain conditions! Share. Share a link to this answer....
Read more >
System.IO.FileNotFoundException: 'Could not load file or ...
I have an application in .net core. the application was running fine, ... System.IO.FileNotFoundException: 'Could not load file or assembly.
Read more >
EasyNetQ IBus.SubscribeAsync<T> throw FileLoadException
Hi all,. I met a strange problem when I try to deploy my app to server environment, the code works fine in my...
Read more >
The RabbitMQ .NET client is an implementation ...
NET client is an implementation of an AMQP 0-9-1 client library for C# (and, ... NET Standard 1.5+ implementation (e.g. .NET Core 2.x)....
Read more >
EasyNetQ 7.5.5
Version Downloads Last updated 8.0.0‑beta94 632 2 months ago 8.0.0‑beta93 301 2 months ago 8.0.0‑beta92 338 2 months ago
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found