Pergunta

I am using Exchange_2010_SP3 .

When I use this code : connect as exchange2010_SP1, oldest items are returned . This is what I expected

exchangeService = new ExchangeService(ExchangeVersion.Exchange2010_SP1,
                                        TimeZoneInfo.Utc);

var items = exchangeService.SyncFolderItems(_folderId, PropertySet.IdOnly, null,
                                            Configuration.BatchSize,
                                            SyncFolderItemsScope.NormalItems,
                                            null);

But when I initialize exchangeService as SP2 , latest items are returned. (This has taken me by total surprise).

exchangeService = new ExchangeService(ExchangeVersion.Exchange2010_SP2,
                                      TimeZoneInfo.Utc);

var items = exchangeService.SyncFolderItems(_folderId, PropertySet.IdOnly, null,
                                            Configuration.BatchSize,
                                            SyncFolderItemsScope.NormalItems,
                                            null);

Trying to figure out, how SyncFolderItems behaves when using different version of exchange in code than that you are trying to connect to. Tried to find documentation related to this but without success.

Any pointers, help?

Foi útil?

Solução

You're exactly right, in Exchange 2010 SP2, the order changed.

From http://msdn.microsoft.com/en-us/library/dn440952(v=exchg.150).aspx: In Exchange Online, Exchange Online as part of Office 365, and versions of Exchange starting with Exchange 2010 SP2, items and folders are returned in order from newest to oldest. In previous versions of Exchange, items and folders are returned from oldest to newest.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top