我正在将垃圾邮件过滤器从Exchange 2013更新到2019。我的传输代理引用了这两个DLL: 当我用Exchange 2019中的新DLL替换这些DLL的2013版本时,以下两行代码都会生成异常: 异常消息为:
“ Microsoft.Exchange.Data.Transport.Smtp.SmtpResponse的类型错误。” …的类型初始值设定项已生成异常。 即使这行简单的代码也会导致异常: 有什么想法为什么SmtpResponse的构造方法会抛出此异常?在Exchange 2013上,此代码已完美运行了多年。Microsoft.Exchange.Data.Common.dll
Microsoft.Exchange.Data.Transport.dll
// Exchange 2019 syntax
SmtpResponse smtpResponse = SmtpResponse.Create("550", "5.7.1", "A single string");
// Exchange 2013 syntax (deprecated under 2019, but still compiles)
SmtpResponse smtpResponse = new SmtpResponse("550", "5.7.1", "A single string");
SmtpResponse smtpResponse = new SmtpResponse();
0 个答案:
没有答案