MS CRM 2011 Plugin Registration Tool: unable to retrieve the organization from the discovery service
Recently we discovered that we could not log into the Plugin Registration tool. It would display the follow error message:
unable to retrieve the organization from the discovery service
Followed by this long detailed error message.
Unhandled Exception: System.InvalidOperationException: Metadata contains a reference that cannot be resolved: ‘https://crmnaorg54346.crm.dynamics.com/XRMServices/2011/Discovery.svc?wsdl’.
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.RetrieveServiceEndpoints(Type contractType, Uri serviceUri)
at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1..ctor(Uri serviceUri)
at Microsoft.Xrm.Sdk.Client.ServiceConfigurationFactory.CreateConfiguration[TService](Uri serviceUri)
at Microsoft.Xrm.Sdk.Client.ServiceProxy`1..ctor(Uri uri, Uri homeRealmUri, ClientCredentials clientCredentials, ClientCredentials deviceCredentials)
at Microsoft.Xrm.Sdk.Client.DiscoveryServiceProxy..ctor(Uri uri, Uri homeRealmUri, ClientCredentials clientCredentials, ClientCredentials deviceCredentials)
at PluginRegistrationTool.CrmConnection.get_DiscoveryService()
at PluginRegistrationTool.CrmConnection.RetrieveOrganizations()
at PluginRegistrationTool.ConnectionsForm.OpenConnection(CrmConnection con)
Inner Exception: System.Net.WebException: Unable to connect to the remote server
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Description.MetadataExchangeClient.MetadataLocationRetriever.DownloadMetadata(TimeoutHelper timeoutHelper)
at System.ServiceModel.Description.MetadataExchangeClient.MetadataRetriever.Retrieve(TimeoutHelper timeoutHelper)
Inner Exception: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 72.215.225.9:443
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
To solve this we had to delete two files.
1. Under Users\username\LiveDeviceID delete the LiveDevice.xml file.
2. Within the Plugin Registration Folder delete the Connections.config file.
3. I have run into cases where you did not have to reboot and cases where you did have to reboot as well, no set pattern.
After these two files were removed (they regenerate), were we able to access the Discovery Service via the Plugin Registration tool.