【发布时间】:2016-10-24 07:57:07
【问题描述】:
我正在尝试构建一个 Web 服务以从外部获取邮件服务器的附件并从那里发送,但出现以下错误:
要成为 XML 可序列化的,从 IEnumerable 继承的类型必须具有 Add(System.Object) 在其所有级别的实现 继承层次结构。 System.Collections.Specialized.StringDictionary 不实现 Add(System.Object)。 [无效操作异常: 反映类型“System.Net.Mail.Attachment”时出现错误。]
我的代码如下:
[WebMethod]
public String SendMailWithAttachment(string mail_sender, string[] mail_receiver, string mail_subject, string mail_text, Attachment att)
...
【问题讨论】:
标签: c# web-services serialization soap