SmptClient.Send throws "Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)"

Gary Fuhr 96 Reputation points
2021-06-09T01:39:31.883+00:00

Unable to send email from within an ASP.NET webform application in dev environment. Working fine in Test & Production.

The following line of code:
smptClient.Send(message)

Generates this exception:
"Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)"

I've tried everything I can find on the web and in this forum, but still get the exception.

Anyone know how to resolve this? Using .Net Framework 4.7.2 and latest version of Windows 10 with all updates as of June 8, 2021.

TIA, Gary.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,251 questions
{count} votes

Accepted answer
  1. Gary Fuhr 96 Reputation points
    2021-06-09T09:26:20.08+00:00

    Not sure what's wrong with SmtpClient.Send(message). Just bugs me when something that's worked for years just stops working for no obvious reason.

    Decided to find a replacement. Changed our send email class to use MailKit. Works like a charm now.

    0 comments No comments

0 additional answers

Sort by: Most helpful