我試圖構建一個Web服務來從外部獲取郵件服務器的附件並從那裏發送它,但是我得到下面錯誤:要成爲可序列化的XML,從IEnumerable繼承的類型必須具有Add(System.Object)的實現
To be XML serializable, types which inherit from IEnumerable must have an implementation of Add(System.Object) at all levels of their inheritance hierarchy. System.Collections.Specialized.StringDictionary does not implement Add(System.Object). [InvalidOperationException: There was an error reflecting type 'System.Net.Mail.Attachment'.]
我的代碼是象下面這樣:
[WebMethod]
public String SendMailWithAttachment(string mail_sender, string[] mail_receiver, string mail_subject, string mail_text, Attachment att)
...
非常感謝,這工作得很好。 –