Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7522893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:38:32+00:00 2026-05-30T02:38:32+00:00

After quite a lot of debugging, I’ve refined a complicated Managed EWS problem down

  • 0

After quite a lot of debugging, I’ve refined a complicated Managed EWS problem down to the following two simple-ish test cases. The first one works, the second one fails:

var view = new ItemView(100) { PropertySet = new PropertySet { EmailMessageSchema.Id } };
var findResults = ews.FindItems(WellKnownFolderName.Inbox, view)
var bindResults = ews.BindToItems(findResults.Select(r => r.Id), new PropertySet { EmailMessageSchema.Sender });

// Sanity check
Assert.AreEqual(1, bindResults.Count());

// The results I care about
Assert.AreEqual("David Seiler", bindResults[0].Sender.Name);
Assert.AreEqual("david.seiler@yahoo.com", bindResults[0].Sender.Address);

One might try to cut out the BindToItems() call, and use FindItems() directly:

var view = new ItemView(100) { PropertySet = new PropertySet { EmailMessageSchema.Sender } };
var findResults = ews.FindItems(WellKnownFolderName.Inbox, view)

// This part still works fine
Assert.AreEqual(1, findResults.Count());

// So does this
Assert.AreEqual("David Seiler", findResults[0].Sender.Name);

// ...but this fails!  Sender.Address is null
Assert.AreEqual("david.seiler@yahoo.com", findResults[0].Sender.Address);

Can anyone tell me where I’ve gone wrong? It really seems, from the documentation, as though this should work. Not all properties can be read through FindItems(), it’s true, but those properties usually throw when I try to access them, and anyway there’s a list of those properties on MSDN and Sender isn’t on it. What’s going on?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T02:38:33+00:00Added an answer on May 30, 2026 at 2:38 am

    Actually I don’t know why, but in the second option, it only load basic information of the sender like the name, but not the Address.

    If you want to load all the sender properties but do not want to bind the full message you can add the following line before the first assert

    service.LoadPropertiesForItems(findResults.Items, new PropertySet(EmailMessageSchema.Sender));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We've been debugging this JBoss server problem for quite a while. After about 10
I look after a site which by nature has to load quite a lot
I have a PHP application that relies on session variables quite a lot. After
I've searched around, but after sifting through quite a lot of posts, I haven't
I have (after quite a bit of work) a web test that will upload
I had this nasty bug that disappeared in the past but now after quite
After playing quite a bit of Bad Company 2 over the last month, I'm
After years of ASP.NET development I'm actually quite surprised that I can't seem to
I am developing a small web app that uses jQuery quite a lot. In
Okay so I have this page with quite a lot of javascript/jQuery in it.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.