2

I am creating my Service like this:

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);

Currently I am using .NET 4.6.1 and Microsoft.Exchange.WebServices v15.0.0.0 (Nuget Version 2.2.0.

I am missing enums for Exchange 2016.

enter image description here

Why is that ?

Felix D.
  • 4,811
  • 8
  • 38
  • 72
  • You just want to connect to EWS using the managed API? Likely you don't need to pass any version in the constructor and it will just work. Or you can see if Microsoft has open sourced the code and just not bothered creating a NuGet package. Or you can pester them to release an updated NuGet package. – mason Dec 14 '17 at 15:36
  • Currently we are using 2013. I need to pass the version or I get an exception. Update to 2016 is planned so I wanted to make it compatible with that too. – Felix D. Dec 14 '17 at 15:39
  • Get what exception? And you got the exception when not passing it with 2013? Did you try not passing it with 2016? – mason Dec 14 '17 at 15:39
  • `Microsoft.Exchange.WebServices.Data.ServiceVersionException: 'Exchange Server doesn't support the requested version.' ` – Felix D. Dec 14 '17 at 15:40
  • That's what I get on 2013 when not passing any version. Sadly I could not test 2016 since I dont have one at place. And I did not bother to find any public server yet. – Felix D. Dec 14 '17 at 15:41
  • Well consider that there may have been breaking changes between 2013 and newer versions. But that may not be the case with 2016, you may not need to pass a version in the constructor at all. So you may be trying to solve a problem that doesn't exist. I'd wait until you have a 2016 server in place to test with before moving any further. – mason Dec 14 '17 at 15:44
  • @mason seems like there is no other solution... – Felix D. Dec 14 '17 at 15:45
  • I listed two additional solutions in the top comment here. – mason Dec 14 '17 at 15:47
  • **here is the latest instruction** how to deploy EWS on the modern platform https://stackoverflow.com/a/74213274/1704458 – T.S. Oct 27 '22 at 23:02

3 Answers3

3

You could also download the latest version of the EWS Managed API from GitHub and build the assembly by yourself, or you use the Exchange.WebServices.Managed.Api nuget package created bymarklamley. It includes the current version 2.2.1.1 of the EWS Managed API project.

zgue
  • 3,793
  • 9
  • 34
  • 39
2

That NuGet package was last updated January 15th 2015. Exchange 2016 was released on October 1st 2016. Since that version of Exchange didn't exist at the time the package was created, and Microsoft didn't add it ahead of time, that explains why it's not there.

mason
  • 31,774
  • 10
  • 77
  • 121
-1

Here I found a workaround:

Browse to the location where you installed the EWS Managed API DLL. The default path set by the installer is the following: C:\Program Files\Microsoft\Exchange\Web Services\<version>\. The path can vary based on whether you download the 32 or 64 bit version of the Microsoft.Exchange.WebServices.dll. Choose Microsoft.Exchange.WebServices.dll and select OK or Add. This adds the EWS Managed API reference to your project.

This should get the "latest" version - or a newer one that the one on NuGet.

Felix D.
  • 4,811
  • 8
  • 38
  • 72
  • The link you found links to the source code on GitHub, which [shows they've updated the enum](https://github.com/OfficeDev/ews-managed-api/blob/master/Enumerations/ExchangeVersion.cs). So I'd just pester Microsoft to release an updated NuGet package so you don't have to rely on a loose DLL reference. – mason Dec 14 '17 at 15:54
  • I will Open a request. Thanks for your help ! – Felix D. Dec 14 '17 at 15:54