none
Unhandled Exception in Microsoft.Exchange.WebServices Library RRS feed

  • Question

  • Hello All,

    I'm seeing an unhandled exception in our WCF application that appears to be originating inside Microsoft's Microsoft.Exchange.WebServices library. The output from the trace llistener that captured the exception is listed below. We're using Microsoft.Exchange.WebServices version 15.0.0.0 (runtime version v2.0.50727), and using .Net 4.5.1. The application creates EWS streaming subscriptions, which I believe are related to the cause of the exception. The stack trace for the exception appears to be entirely in the Microsoft code, so I'm reaching out here to see if any experts here know of this problem and/or have a recommendation on how to proceed.

    <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical">
    <TraceIdentifier>UnhandledException</TraceIdentifier>
    <Description>Unhandled exception</Description>
    <AppDomain>REDACTED.exe</AppDomain>
    <Exception>
    <ExceptionType>System.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
    <Message>Object reference not set to an instance of an object.</Message>
    <StackTrace>   at Microsoft.Exchange.WebServices.Data.StreamingSubscriptionConnection.InternalOnDisconnect(Exception ex)
       at Microsoft.Exchange.WebServices.Data.StreamingSubscriptionConnection.OnRequestDisconnect(Object sender, HangingRequestDisconnectEventArgs args)
       at Microsoft.Exchange.WebServices.Data.HangingServiceRequestBase.InternalOnDisconnect(HangingRequestDisconnectReason reason, Exception exception)
       at Microsoft.Exchange.WebServices.Data.GetStreamingEventsResponse.ReadElementsFromXml(EwsServiceXmlReader reader)
       at Microsoft.Exchange.WebServices.Data.ServiceResponse.LoadFromXml(EwsServiceXmlReader reader, String xmlElementName)
       at Microsoft.Exchange.WebServices.Data.GetStreamingEventsRequest.ParseResponse(EwsServiceXmlReader reader)
       at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ReadResponse(EwsServiceXmlReader ewsXmlReader)
       at Microsoft.Exchange.WebServices.Data.HangingServiceRequestBase.ParseResponses(Object state)
       at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
       at System.Threading.ThreadPoolWorkQueue.Dispatch()
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()</StackTrace>
    <ExceptionString>System.NullReferenceException: Object reference not set to an instance of an object.
       at Microsoft.Exchange.WebServices.Data.StreamingSubscriptionConnection.InternalOnDisconnect(Exception ex)
       at Microsoft.Exchange.WebServices.Data.StreamingSubscriptionConnection.OnRequestDisconnect(Object sender, HangingRequestDisconnectEventArgs args)
       at Microsoft.Exchange.WebServices.Data.HangingServiceRequestBase.InternalOnDisconnect(HangingRequestDisconnectReason reason, Exception exception)
       at Microsoft.Exchange.WebServices.Data.GetStreamingEventsResponse.ReadElementsFromXml(EwsServiceXmlReader reader)
       at Microsoft.Exchange.WebServices.Data.ServiceResponse.LoadFromXml(EwsServiceXmlReader reader, String xmlElementName)
       at Microsoft.Exchange.WebServices.Data.GetStreamingEventsRequest.ParseResponse(EwsServiceXmlReader reader)
       at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ReadResponse(EwsServiceXmlReader ewsXmlReader)
       at Microsoft.Exchange.WebServices.Data.HangingServiceRequestBase.ParseResponses(Object state)
       at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
       at System.Threading.ThreadPoolWorkQueue.Dispatch()
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()</ExceptionString>
    </Exception>
    </TraceRecord>

    Wednesday, June 20, 2018 4:25 PM

All replies

  • The first place to start would be to compile the latest version of the Managed API from github https://github.com/OfficeDev/ews-managed-api (this library has been open source for a number of years). There has been a number of fixes around streaming subscriptions so its most likely its already been fixed. If it doesn't fix the issue you now have the source so you should be able to debug and fix the issue yourself (and post the fix back to repo).

    Cheers
    Glen

    Wednesday, June 20, 2018 11:47 PM