jstedfast/MailKit

System.BadImageFormatException: Could not load file or assembly 'System.Buffers, Version=4.0.3.0..."

Closed this issue · 2 comments

After updating to Mailkit 3.5.0 started getting an error when trying to sendmail using MailKit.

Exception: System.BadImageFormatException: Could not load file or assembly 'System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)
File name: 'System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' ---> System.BadImageFormatException: Cannot load a reference assembly for execution.
at MailKit.ByteArrayBuilder..ctor(Int32 initialCapacity)
at MailKit.Net.Smtp.SmtpStream.ReadResponse(CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.Connect(String host, Int32 port, SecureSocketOptions options, CancellationToken cancellationToken)

https://stackoverflow.com/questions/63019110/could-not-load-file-or-assembly-system-buffers-version-4-0-2-0 might be helpful.

I have no idea what to recommend. This seems like a problem with your system?

Thank you. I'll pursue that angle.