我有一个 EWS 流订阅,我想持续运行。它等待特定收件箱中的新邮件事件,当该事件触发时,它会读取电子邮件并将内容发布到不同的 Web 服务。在大多数情况下,这非常有效,但是每次都会抛出此 System.Xml.XmlException:
Unhandled Exception: System.Xml.XmlException: '▼', hexadecimal value 0
invalid character. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& e
32& outOrChars)
at System.Xml.XmlTextReaderImpl.ParseText()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at Microsoft.Exchange.WebServices.Data.EwsXmlReader.Read()
at Microsoft.Exchange.WebServices.Data.EwsXmlReader.Read(XmlNodeTyp
)
at Microsoft.Exchange.WebServices.Data.EwsXmlReader.InternalReadEle
mespace xmlNamespace, String localName, XmlNodeType nodeType)
at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ReadRespo
viceXmlReader ewsXmlReader)
at Microsoft.Exchange.WebServices.Data.HangingServiceRequestBase.Pa
es(Object state)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(
te)
at System.Threading.ExecutionContext.Run(ExecutionContext execution
ontextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThr
kItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
我看过有关此异常的其他帖子,但似乎没有一个有解决方案。我怎样才能阻止它被抛出?
更新:
以防万一有人遇到同样的问题。我们将服务器升级到 2010 sp2,问题似乎已得到解决。
最佳答案
这是您无法控制的内部错误。
如果服务器是 2007 sp1,则将其升级到 2010。如果是 2010,请验证其是否使用最新的服务版本补丁运行。
如果完成所有操作后问题仍然发生,请使用您的 MSDN 订阅(或该软件的当前支持契约(Contract))并联系 Microsoft 支持并让他们与您一起调查。他们可能有一个未发布的服务版本,可以解决此问题。
关于c# - EWS 流订阅 System.Xml.XmlException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9946081/