I have recently tried to write an application in c# using EWS to read the contents of an exchange mailbox. I have the login working (im 90% sure of this) but when i try to use examples from online on how to display the content of the inbox i am greeted with the errors “The type or namespace ‘searchfilter’ could not be found. (Are you missing a using directive or an assembly reference?)”. Usually this means i just need to add the reference to my project, however i already have Microsoft.Exchange.Webservices added as a reference. Anyone seen this issue before? Any ideas?
using:
windows 7
visual studio 2010
.net 4 is installed but my target framework is 3.5
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using Microsoft.Exchange.WebServices;
using Microsoft.Exchange.WebServices.Data;
using Microsoft.Exchange.WebServices.Autodiscover;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Xml;
If that is a direct copy/paste of the error message, have you checked that your capitalization is correct? It should be “SearchFilter” not “searchfilter”
Here is the msdn reference:
http://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.searchfilter(v=EXCHG.80).aspx