You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, The UWP package we own throws this exception (below).
The call to DnsNativeMethods.FreeDnsQueryResults(queryResultsPtr); is called without a try catch around it and this stops further processing of auto discovery.
0x80131522 System.TypeLoadException: Unresolved P/Invoke method 'dnsapi.dll!DnsRecordListFree' from this method. Please look for this method in build warnings for more details.
at Microsoft.Exchange.WebServices.Dns.DnsNativeMethods.DnsRecordListFree(IntPtr, DnsNativeMethods.FreeType) + 0x2d
at Microsoft.Exchange.WebServices.Dns.DnsNativeMethods.FreeDnsQueryResults(IntPtr) + 0x8
at Microsoft.Exchange.WebServices.Dns.DnsClient.DnsQuery[T](String, IPAddress) + 0x2c0
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverDnsClient.FindBestMatchingSrvRecord(String) + 0x8d
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverDnsClient.FindAutodiscoverHostFromSrv(String) + 0x24
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetRedirectionUrlFromDnsSrvRecord(String) + 0x3a
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetSettings[TGetSettingsResponseCollection, TSettingName](List`1, List`1, Nullable`1, AutodiscoverService.GetSettingsMethod`2, Func`1) + 0x381
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetUserSettings(List`1, List`1) + 0xcb
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.InternalGetSoapUserSettings(String, List`1) + 0x12a
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetUserSettings(String, UserSettingName[]) + 0x5a
at Microsoft.Exchange.WebServices.Data.ExchangeService.GetAutodiscoverUrl(String, ExchangeVersion, AutodiscoverRedirectionUrlValidationCallback) + 0x87
at Microsoft.Exchange.WebServices.Data.ExchangeService.AutodiscoverUrl(String, AutodiscoverRedirectionUrlValidationCallback) + 0x34
The text was updated successfully, but these errors were encountered:
So I recently ran into this also when moving from the full framework version to this version. The short of it was, I forked the original Microsoft repo and converted it to .NET Standard 2 (didn't take much time and there were few hiccups, just added a few NuGets and removed one System.Web using). In the end though I tried to make AutoDiscovery work and couldn't. I manually entered the URL (which you'll have to find, it will be unique to your environment possibly):
var service = new ExchangeService(ExchangeVersion.Exchange2013_SP1)
{
Credentials = new WebCredentials(username, password, domain)
};
// To future me, when this URL breaks at some point because it will, it has to be
// updated to whatever the URL is on the new server. Try to see if AutoDiscovery is working
// again and also check that ExchangeVersion is still correct.
service.Url = new Uri(exchangeUrl);
service.EnableScpLookup = false;
service.Timeout = (1000 * 60) * 5; // 5 Minutes
Not ideal but sometimes you have to get stuff done.
Hello, The UWP package we own throws this exception (below).
The call to DnsNativeMethods.FreeDnsQueryResults(queryResultsPtr); is called without a try catch around it and this stops further processing of auto discovery.
The text was updated successfully, but these errors were encountered: