概要:アプリケーションはExchangeServiceBinding
コマンドを受け入れません。ExchangeServiceBinding名前空間エラー
詳細:
私は非常に大規模なメールボックスをループしようとしていますので、私は200個のメールチャンクに受信トレイを破るために、インデックスを使用しています。 (下記参照)私は見つけることができる唯一の例では、
「ExchangeServiceBinding」型または名前空間名を返す保つ見つかりませんでした(あなたがusingディレクティブまたはアセンブリ参照が不足している?)
どの私はそれがusing Microsoft.Exchange.WebServices;
を使用しているので、私は奇妙に思えます。どんなアイデアや助けも大歓迎です。私はWindows 7とVisual Studio 2010を実行しており、Exchange 2007メールボックスにアクセスしようとしています。
物事私が試してみた:
- がスタックに私の机の上に頭をスラミングMSDN
- を検索 オーバーフロー
- を検索するGoogleの
- を検索
- 試行錯誤
コード:
// Create binding variable to be used for GetItemsFromInbox().
// Set up the binding with credentials and URL.
ExchangeServiceBinding binding = new ExchangeServiceBinding();
binding.Credentials = new NetworkCredential(dUser, dPassword, dDomain);
binding.Url = new Uri("https://" + ExchangeServerName + "/EWS/Exchange.asmx");
// Set up the binding for Exchange impersonation.
binding.ExchangeImpersonation = new ExchangeImpersonationType();
binding.ExchangeImpersonation.ConnectingSID = new ConnectingSIDType();
binding.ExchangeImpersonation.ConnectingSID.PrimarySmtpAddress = "mailboxnamehere”;
// Call GetItemsFromInbox()
int index = 0;
bool looping = true;
while (looping)
{
List<ItemType> items = GetItemsFromInbox(binding, index, 200, index);
if (items == null || items.count == 0)
{
looping = false;
break;
}
// Do your work here
}
あなたのプロジェクトはewsアセンブリを参照していますか? –
はい。 Microsoft.Exchange.WebServicesを使用します。 Microsoft.Exchange.WebServices.Dataを使用しています。 Using Microsoft.Exchange.WebServices.Autodiscover; – toosweetnitemare