C# Exchange Service suddenly giving error The property Hashtags is valid only for Exchange Exchange2015 or later versions

I have a Windows Service written in C# that polls an Exchange server to process mails to an unattended email box.

It's been working fine, until today when it's throwing up the following error:-

EXCEPTION: Microsoft.Exchange.WebServices.Data.ServiceVersionException: The property Hashtags is valid only for Exchange Exchange2015 or later versions.
   at Microsoft.Exchange.WebServices.Data.PropertyBag.set_Item(PropertyDefinition propertyDefinition, Object value)
   at Microsoft.Exchange.WebServices.Data.ComplexPropertyDefinitionBase.InternalLoadFromXml(EwsServiceXmlReader reader, PropertyBag propertyBag)
   at Microsoft.Exchange.WebServices.Data.ComplexPropertyDefinitionBase.LoadPropertyValueFromXml(EwsServiceXmlReader reader, PropertyBag propertyBag)
   at Microsoft.Exchange.WebServices.Data.PropertyBag.LoadFromXml(EwsServiceXmlReader reader, Boolean clear, PropertySet requestedPropertySet, Boolean onlySummaryPropertiesRequested)
   at Microsoft.Exchange.WebServices.Data.ServiceObject.LoadFromXml(EwsServiceXmlReader reader, Boolean clearPropertyBag, PropertySet requestedPropertySet, Boolean summaryPropertiesOnly)
   at Microsoft.Exchange.WebServices.Data.EwsServiceXmlReader.ReadServiceObjectsCollectionFromXml[TServiceObject](XmlNamespace collectionXmlNamespace, String collectionXmlElementName, GetObjectInstanceDelegate`1 getObjectInstanceDelegate, Boolean clearPropertyBag, PropertySet requestedPropertySet, Boolean summaryPropertiesOnly)
   at Microsoft.Exchange.WebServices.Data.EwsServiceXmlReader.ReadServiceObjectsCollectionFromXml[TServiceObject](String collectionXmlElementName, GetObjectInstanceDelegate`1 getObjectInstanceDelegate, Boolean clearPropertyBag, PropertySet requestedPropertySet, Boolean summaryPropertiesOnly)
   at Microsoft.Exchange.WebServices.Data.GetItemResponse.ReadElementsFromXml(EwsServiceXmlReader reader)
   at Microsoft.Exchange.WebServices.Data.ServiceResponse.LoadFromXml(EwsServiceXmlReader reader, String xmlElementName)
   at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.ParseResponse(EwsServiceXmlReader reader)
   at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ParseResponse(EwsServiceXmlReader reader, WebHeaderCollection responseHeaders)
   at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ReadResponse(EwsServiceXmlReader ewsXmlReader, WebHeaderCollection responseHeaders)
   at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.ReadResponseXml(Stream responseStream, WebHeaderCollection responseHeaders)
   at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.ReadResponse(IEwsHttpWebResponse response)
   at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.InternalExecute()
   at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
   at Microsoft.Exchange.WebServices.Data.ExchangeService.InternalLoadPropertiesForItems(IEnumerable`1 items, PropertySet propertySet, ServiceErrorHandling errorHandling)
   at Microsoft.Exchange.WebServices.Data.ExchangeService.LoadPropertiesForItems(IEnumerable`1 items, PropertySet propertySet)
   at MyServiceName.MyServiceName.CheckForNewEmails(ExchangeService service) in C:\TFSOnline\RPM Tools\MyServiceName\MyServiceName\MyServiceName.cs:line 177
   at MyServiceName.MyServiceName.RunACheck(Object state) in C:\TFSOnline\RPM Tools\MyServiceName\MyServiceName\MyServiceName.cs:line 117

The line causing the crash is:

PropertySet properties = (BasePropertySet.FirstClassProperties);
service.LoadPropertiesForItems(emails, properties);

The specific error is:

Microsoft.Exchange.WebServices.Data.ServiceVersionException: 
The property Hashtags is valid only for Exchange Exchange2015 or later versions.

I'm not using or accessing Hashtags anywhere, so presumably it's contained in BasePropertySet.FirstClassProperties.

As I mentioned, I've been using the above code quite happily up to now, it's only started giving this error today.

I'm using the latest EWS Stable Build: Exchange.WebServices.Managed.Api 2.2.1.1

BasePropertySet only has one other item, IdOnly, and the property I'm after is InternetMessageId, so I figured I'd just use that:

PropertySet properties = (BasePropertySet.IdOnly);
service.LoadPropertiesForItems(emails, properties);

Turns out InternetMessageId isn't covered by the property to get IDs...

EXCEPTION: Microsoft.Exchange.WebServices.Data.ServiceObjectPropertyException: 
You must load or assign this property before you can read its value.
   at Microsoft.Exchange.WebServices.Data.PropertyBag.get_Item(PropertyDefinition propertyDefinition)
   at Microsoft.Exchange.WebServices.Data.EmailMessage.get_InternetMessageId()

The section of code giving the error hasn't changed, and as far as I can tell there's been no update to Office 365 that's affected Exchange.

To double-check, I took a previous version (compiled code, not source code that I recompiled) and installed that instead: still got the same error.

Anyone had this error before? I've Googled it but didn't get a single hit.

Edit: Tried installing the service on another machine on the off-chance it was specific to the machine it had been on.

Still get the same error, even with the previous code.

Try not to use PropertySet properties = (BasePropertySet.FirstClassProperties);, because it will likely return fields more than you need. (more than 50 properties)

Try load those you need it.

PropertySet ps = new PropertySet(
                                            ItemSchema.Subject,
                                            ItemSchema.InReplyTo,
                                            ItemSchema.Body,
                                            ItemSchema.DateTimeSent,
                                            ItemSchema.DisplayTo,
                                            ItemSchema.Importance,
                                            EmailMessageSchema.From,
                                            ItemSchema.UniqueBody, 
                                            ItemSchema.MimeContent, 
                                            ItemSchema.HasAttachments, 
                                            ItemSchema.Attachments
                                            );

`The property Hashtags is valid only for Exchange Exchange2015 or , As your mentioned, the error only occurs with specific email. You could refer to the following link: C# Exchange Service suddenly giving error  I have a Windows Service written in C# that polls an Exchange server to process mails to an unattended email box. It's been working fine, until today when it's throwing up the following error:- EXCEPTION: Microsoft.Exchange.WebServices.Data.ServiceVersionException: The property Hashtags is valid only for Exchange Exchange2015 or later versions.

You could also try setting the requestedServerVersion in the ExchangeService constructor explicitly to something higher. If this involves Office365, bear in mind that EWS is not receiving further updates.

Verifying the results of an EWS or EWS Managed API call, Learn how to verify the results of your EWS or EWS Managed API calls. :m="​https://schemas.microsoft.com/exchange/services/2006/messages" might be tempted to only check the ResponseClass of the operation. ResponseClass="​Error"> <m:MessageText>Property is not valid for this object type. Occurs when you try to get user availability for a recipient that is located on an Exchange server that is running a version of Exchange that is earlier than Exchange 2007 and the request to retrieve free/busy information for the recipient from the public folder server failed because the organizational unit did not have a public folder server

You could also try setting the requestedServerVersion in the ExchangeService constructor explicitly to something higher. For Office365, bear in mind that EWS is not receiving further updates.

Counting number of grouped rows in mysql, What I want to achieve now is that from the above result, the rows are counted and 3 is The COUNT() function allows you to count all rows or only rows that match a specified condition. C# Exchange Service suddenly giving error The property Hashtags is valid only for Exchange Exchange2015 or later versions · How to  Starting with service mailbox versions 14.16.0135 and 14.15.0057.000, a mailbox hosted by Exchange Online or Exchange Online as part of Office 365 can have up to 20 subscriptions, and a target Exchange 2013 on-premises mailbox can have up to 5000 subscriptions.

I had this same issue. I noticed that you and I both did not specify which exchange server we were using. That worked for me for a long time but eventually I got this error. Specifying which exchange server fixed this for me.

VMware Newsletter Archive : 2015 : April |VMware Communities, This week I would like to direct your attention to our latest VMware TAM Blog GM of VMWare's Cloud Services business unit gives us an insider's look into how and with updates announced at Partner Exchange, v6 now includes vRealize Not only with hardware (most of vSphere 5.5 hardware is in HCL also for version  This example assumes that service is a valid ExchangeService object and that the user has been authenticated to an Exchange server. The local variable itemId is the Id of the item to update. // As a best practice, limit the properties returned to only those that are required.

Solved it. Turns out it was something in a specific email.

Originally the code was ordered as:-

PropertySet properties = (BasePropertySet.FirstClassProperties);
service.LoadPropertiesForItems(emails, properties);

foreach (var email in emails)
{
    try {
        <Process Email>
    }
}

I re-ordered the code as:-

foreach (var email in emails)
{
    try {
        var list = new List<EmailMessage> { email };
        PropertySet properties = (BasePropertySet.FirstClassProperties);
        service.LoadPropertiesForItems(list, properties);
        <Process Email>
    }
} 

So, getting the properties individually for each email, rather than all together. Has to be done via a List, as that's what LoadPropertiesForItems takes.

In this case, one of the emails has something (presumably the Hashtags property) which is causing the error.

Now all the rest of the emails get processed correctly, and the one that causes the error is skipped.

Although annoyingly, because I can't access the properties I can't actually log any information about it.

VMware Newsletter Archive |VMware Communities, VMTurbo is giving away a great home lab just for watching a webinar The vCenter Server Service stops unexpectedly while removing an Server 6.0 fails with the error: Incompatible MSSQL version with vCenter Server 6.0 (2111541) and with updates announced at Partner Exchange, v6 now includes  (To add Exchange to Linux mail, we only put the name/IP of Exchange server and Administrator account into it. Besides, Linux mail server also support Autodiscover option to lookup Exchange e-mail. To create a mailbox connecting to Exchange email, we only create name and give a exchange email)

50 Hashtags For Finance Marketers, So, we're giving you 50 hashtags for finance marketers (broken down When it comes to marketing for financial services, social media can If you want to filter through tweets relating to a particular exchange, these hashtags are vital. or keep on top of the latest developments, the following hashtags are  F9{-- your thumbprint --}7398 was found but is not valid for use with Exchange Server (reason: PrivateKeyMissing). Solution. You need to run a repair on your certificate. 1. Click Start > type “MMC.exe” > add/remove snap in > Certificates > Computer Account > Local Computer > Finish > OK.

Site Map: (T), Latest Edition: TextCode 1.4 (compatible with files encrypted by TC 1.3, infos in the program! TextCutie not only provides cute pictures, but also pretty font Marketing via Text Messaging TextHub gives you the tool set needed to market new p mobile app for Textile Exchange's 2015 Textile Sustainability Conference. He is passionate about Exchange, Lync, Active Directory, PowerShell, and Security. Besides writing his personal Exchange blog, LetsExchange.blogspot.com, he regularly participates in the Exchange TechNet forums and is the author of the book “Microsoft Exchange Server 2013 High Availability.”

All EWS functionality is associated with a version of the schema. New EWS schema versions are introduced in new releases of Exchange Server or Exchange Online. The RequestServerVersion element contains a Version attribute that maps the server version to the schema version. This article provides information about when each operation was introduced.

Comments
  • This was the change I made: The like looks like this: private const string EmailQueryString = "Kind:email"; ... FindItemsResults<Item> results = exchangeService.FindItems(folderId, EmailQueryString, new ItemView(itemViewSize)); I remove the constant, this "Kind:email" create the failure, not a direct answer for the question but fails even on the FindItems, probably help.