創建自定義Sharepoint Web服務時嘗試序列化傳輸類時收到錯誤。使用XmlSerializer時出現Inner SecurityException
我的可序列化類沒有錯誤。它們以我以前使用過的方式構建,並且可以在本地測試環境中成功序列化,只有在部署Sharepoint Web服務時纔會出現此問題。
System.InvalidOperationException was caught
Message=There was an error generating the XML document.
Source=System.Xml
StackTrace:
at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
at System.Xml.Serialization.XmlSerializer.Serialize(TextWriter textWriter, Object o, XmlSerializerNamespaces namespaces)
at SPServiceExtensions.DTOSerializerHelper.SerializeDTO(SharepointDTO dto)
InnerException: System.Security.SecurityException
Message=Request failed.
Source=xo46jp-i
StackTrace:
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterSharepointDTO.Write4_SharepointDTO(String n, String ns, SharepointDTO o, Boolean isNullable, Boolean needType)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterSharepointDTO.Write5_SharepointDTO(Object o)
InnerException:
內部SecurityException不熟悉。什麼導致這個異常?