The Autodiscover service couldn't be located

倾然丶 夕夏残阳落幕 提交于 2019-12-05 11:29:18
Henning Krause

It's very unlikely that this is causing the problem. Typically, if AutoDiscover fails, it's because of invalid credentials or network connectivity issues.

Enable tracing on the ExchangeService instance (MSDN article) to see what is going on.

I realize this post is a few years old, but I'm offering an additional solution simply for the sake of documentation.

Another possible cause of this behavior is the client is attempting to force a TLS 1.2 connection when the EWS server is supporting only TLS 1.0. I was about to surrender investigating this very behavior - an EWS app worked on one box, and the same app failed on a different box (going to the same mailbox) - and the problem was one machine could negotiate TLS 1.0, which worked, while the other could do TLS 1.2 only, which failed. Enabling client TLS 1.0 outbound connections in the registry (HKLM\System\CCS\Services\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client, DWORD value 'Enabled' set to 0x1 fixed the problem. No reboot required.

And just to add another solution - I was struggling because of the opposite problem to David W above - my exchange server only supported TLS1.2, but my app (.net 4.5) only supported 1.0 by default.

Fixed by adding:

System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;

to my app startup code. I believe this is enabled by default for .net 4.6 onwards

The specific error I was getting was:

<Trace Tag="AutodiscoverConfiguration" Tid="1" Time="2018-10-29 15:32:40Z">
 failed: WebException (The underlying connection was closed: An unexpected error occurred on a send.)
</Trace>
Exception thrown: 'Microsoft.Exchange.WebServices.Data.AutodiscoverLocalException' in Microsoft.Exchange.WebServices.dll
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!