如何处理EWS挂?

时间:2019-02-01 08:26:58

标签: c# asp.net .net exchangewebservices

有时在您收到电子邮件时挂起,因此整个程序挂起,如何检查服务挂起?

ExchangeService service = new Sender().GetService(sourceEmail);
SearchFilter filter = new 
SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false));
ItemView view = new ItemView(20) { PropertySet = PropertySet.IdOnly };
if (oldest) view.OrderBy.Add(ItemSchema.DateTimeReceived,SortDirection.Ascending);
FolderId sharedMailbox = new FolderId(WellKnownFolderName.Inbox, sourceEmail);

/* hangs on this call */
FindItemsResults<Item> findResults = service.FindItems(sharedMailbox, filter, view);

1 个答案:

答案 0 :(得分:0)

我遇到了 FindItems 挂起的问题,

这似乎与我有一个我没有关闭的 StreamingSubscriptionConnection 对象有关。