locked
CRM 2011 On Premise Discovery Service error connecting to Plugin Registration Tool

    Question

  • When i try to access the Discovery Service URL (http://orgName:5555/XRMServices/2011/Discovery.svc) from dev resources i get the following error.

     

    An error has occurred.

    Try this action again. If the problem continues, check the Microsoft Dynamics CRM Community for solutions or contact your organization's Microsoft Dynamics CRM Administrator. Finally, you can contact Microsoft Support.

    System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Crm.MainApplication.Application_Error(Object sender, EventArgs eventArguments)

     

     Please let me know what i am doing wrong. I have looked at some others that had error accessing the URL and had success by adding ?wsdl but i get the same error as above.

     

    Plugin Registration Tool connection shows follwing error.

     

    Unhandled Exception: System.InvalidOperationException: Metadata contains a reference that cannot be resolved: 'https://orgName:5555/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 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 PluginRegistrationTool.ManagedTokenDiscoveryServiceProxy..ctor(Uri serviceUri, ClientCredentials userCredentials)

       at PluginRegistrationTool.CrmConnection.get_DiscoveryService()

       at PluginRegistrationTool.CrmConnection.RetrieveOrganizations()

       at PluginRegistrationTool.ConnectionsForm.OpenConnection(CrmConnection con)

    Inner Exception: System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send.

       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.IO.IOException: The handshake failed due to an unexpected packet format.

       at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)

       at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)

       at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)

       at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)

       at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)

       at System.Threading.ExecutionContext.runTryCode(Object userData)

       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)

       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)

       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

       at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)

       at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)

       at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)

       at System.Net.ConnectStream.WriteHeaders(Boolean async)

     

     

    Thanks,


    Monday, July 11, 2011 1:03 PM

Answers

  • I had tried that but it did not work. I did find the error though. This was related to having multiple bindings in IIS. I removed one of the ports and now have a single port for CRM, restarted IIS and it worked.
    • Marked as answer by smbhakta Tuesday, July 12, 2011 9:04 PM
    Tuesday, July 12, 2011 9:04 PM

All replies

  • Hi,

    Try the solution mentioned in the following blog post: http://030bacf.netsolhost.com/WordPress/?cat=63

    I hope this resolves your problem.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Monday, July 11, 2011 3:48 PM
  • I had tried that but it did not work. I did find the error though. This was related to having multiple bindings in IIS. I removed one of the ports and now have a single port for CRM, restarted IIS and it worked.
    • Marked as answer by smbhakta Tuesday, July 12, 2011 9:04 PM
    Tuesday, July 12, 2011 9:04 PM
  • Solution that Worked for me is to remove the "COM_Plus" environment variable from "My Computer" - properties - Advanced settings - Environment Variables - System Variables.

    Friday, April 13, 2012 4:26 PM
  • SQL server memory usage resulted in <5% available on host server.  Changing the maximum sever memory value (Server Properties > Memory) resolved this problem.

    Presumably it won't adversely affect normal CRM performance.  I expect the high SQL Server memory usage was down to a temporary workload requirement.

    Tuesday, December 9, 2014 1:47 PM