2017-02-21 8 views
1

StreamingSubscriptionを使用するアプリケーションを開発するためのMicrosoftの推奨事項に従います。それは動作しますが、私は常にSystem.ArgumentNullExceptionを取得します 次のコードに。EWS managed API 2.2 StreamingSubscription例外

ExchangeService srv = new ExchangeService(ExchangeVersion.Exchange2010_SP2); 

     //service.AutodiscoverUrl("[email protected]"); 
     srv.Credentials = new WebCredentials("xxx", "xxx", "xxx");   
     srv.Url = new Uri("https://xx.xx.nl/ews/exchange.asmx"); 

     FolderId gpInbox = new FolderId(WellKnownFolderName.Inbox, new Mailbox("[email protected]")); 

     // Subscribe to streaming notifications in the Inbox. 
     StreamingSubscription sss = srv.SubscribeToStreamingNotifications(
      new FolderId[] { WellKnownFolderName.Inbox }, 
      EventType.NewMail); 

     StreamingSubscriptionConnection c = new StreamingSubscriptionConnection(srv, 30); 
     { 
      c.AddSubscription(sss); 
      c.OnNotificationEvent += OnNotificationEvent; 
      c.OnDisconnect += OnDisconnect; 
      c.Open(); 
     } 

例外は、私は、これは例外がスローされた理由を見つけることができません

StreamingSubscription sss = srv.SubscribeToStreamingNotifications(
      new FolderId[] { WellKnownFolderName.Inbox }, 
      EventType.NewMail); 

によってスローされます。 Nugetパッケージを使用して最新バージョンのAPIをインストールしました

答えて

2

EWS Managed APIの最新版を入手するには、GitHub https://github.com/OfficeDev/ews-managed-apiからコンパイルする必要があります.NuGetのバージョンはかなり古く、ソースが公開されました。サブスクリプションに関する問題の多くは、https://github.com/OfficeDev/ews-managed-api/issues?page=1&q=is%3Aissue+is%3Aclosed&utf8=%E2%9C%93(および記載されていない他のもの)が原因で発生する可能性があります。

+0

ご返信ありがとうございます。私はそれをダウンロードして再コンパイルしましたが、引き続き引数の例外がスローされます。これはアプリの動作を引き起こしません。なぜこの例外がスローされるのですか? – Shift

+0

次のことは、根底にあるソースコードを調べて、例外がスローされた理由を考え出し、バグであれば修正することです。 –

関連する問題