Recently, we had a customer who upgraded their CRM 2011 Online to CRM 2013 Online. They had a few users who used CRM Outlook Client (Offline and Online).

Upon migration, they installed the CRM 2013 Outlook Client and were unable to open or create any CRM records from CRM Outlook Client.  They would see a “Waiting for webpage to Load from CRM server” popup.

Upon further investigation, the below exception was displayed in the trace file.

Exception occurred when authenticating with serverType: Remote Exception: System.InvalidOperationException: Metadata contains a reference that cannot be resolved: ‘https://myorg.api.crm5.dynamics.com/XRMServices/2011/Organization.svc?wsdl’;. —> System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required.
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Description.MetadataExchangeClient.MetadataLocationRetriever.DownloadMetadata(TimeoutHelper timeoutHelper)
at System.ServiceModel.Description.MetadataExchangeClient.MetadataRetriever.Retrieve(TimeoutHelper timeoutHelper)
— End of inner exception stack trace —
at System.ServiceModel.Description.MetadataExchangeClient.MetadataRetriever.Retrieve(TimeoutHelper timeoutHelper)
at System.ServiceModel.Description.MetadataExchangeClient.ResolveNext(ResolveCallState resolveCallState)
at System.ServiceModel.Description.MetadataExchangeClient.GetMetadata(MetadataRetriever retriever)
at System.ServiceModel.Description.MetadataExchangeClient.GetMetadata(Uri address, MetadataExchangeClientMode mode)
at Microsoft.Xrm.Sdk.Client.ServiceMetadataUtility.RetrieveServiceEndpointMetadata(Type contractType, Uri serviceUri, Boolean checkForSecondary)
at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1..ctor(Uri serviceUri, Boolean checkForSecondary)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceConfiguration..ctor(Uri serviceUri)
at Microsoft.Xrm.Sdk.Client.ServiceConfigurationFactory.CreateConfiguration[TService](Uri serviceUri)
at Microsoft.Crm.Outlook.ClientAuth.ClientAuthProvidersFactory`1.GetAuthProvider(Uri endPoint, Credential credentials, AuthUIMode uiMode, Uri webEndPoint, IClientOrganizationContext context, Form parentWindow)
at Microsoft.Crm.Application.SMWrappers.ClientOrganizationContextFactory.ClientOrganizationContext.Authenticate(CrmServerType serverType)

Cause

Quite obviously, the request was not able to make it through the proxy.  In my customer’s case, they had specified a proxy PAC file within the internet options and the settings were driven by Group policy. Upon further analysis, I understood that when a proxy PAC file is specified within the user’s Internet Options it will establish a new .NET AppDomain to be created to process the PAC file in the Outlook process. The Microsoft Dynamics CRM for Outlook must switch between the one being used for the client and the newly created AppDomain for the proxy PAC file into the .NET AppDomain which happens to more restricted. The solution is to instruct Microsoft.Crm.Application.Outlook.WebFormsHost.exe to use the default Windows proxy settings.

Solution

1. Close Microsoft Outlook
2. Navigate to ‘C:\Program Files\Microsoft Dynamics CRM\Client\res\web\bin’ folder
3. Create a file with the name ‘Microsoft.Crm.Application.Outlook.WebFormsHost.exe.config’
4. Copy the below contents to the file





http://yourproxy/yourpacfile;


5. Save the file and reopen Microsoft Outlook