Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

'Metadata contains a reference that cannot be resolved' error when integrating a Dynamics 365 client online

Posted on by 345

Hi there

We are having an issue integrating an online client with Dynamics 365. The application works with all other online clients but for some reason we are having an issue with this specific one. The error is as below 

Job fail to execute!System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Metadata contains a reference that cannot be resolved: 'xxxxxxxx.api.crm4.dynamics.com/.../Organization.svc'. ---> System.InvalidOperationException: There is an error in XML document (1, 1298). ---> System.Xml.XmlException: The maximum nametable character count quota (16384) has been exceeded while reading XML data. The nametable is a data structure used to store strings encountered during XML processing - long XML documents with non-repeating element names, attribute names and attribute values may trigger this quota. This quota may be increased by changing the MaxNameTableCharCount property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 1298. at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3) at System.Xml.XmlExceptionHelper.ThrowMaxNameTableCharCountExceeded(XmlDictionaryReader reader, Int32 maxNameTableCharCount) at System.Xml.XmlBaseReader.QuotaNameTable.Add(Int32 charCount) at System.Xml.XmlBaseReader.QuotaNameTable.Add(String value) at System.Xml.Serialization.XmlSerializationReader.ToXmlQualifiedName(String value, Boolean decodeName) at System.Web.Services.Description.ServiceDescriptionSerializationReader.Read72_OperationOutput(Boolean isNullable, Boolean checkType) at System.Web.Services.Description.ServiceDescriptionSerializationReader.Read74_Operation(Boolean isNullable, Boolean checkType) at System.Web.Services.Description.ServiceDescriptionSerializationReader.Read75_PortType(Boolean isNullable, Boolean checkType) at System.Web.Services.Description.ServiceDescriptionSerializationReader.Read124_ServiceDescription(Boolean isNullable, Boolean checkType) at System.Web.Services.Description.ServiceDescriptionSerializationReader.Read125_definitions() at System.Web.Services.Description.ServiceDescription.ServiceDescriptionSerializer.Deserialize(XmlSerializationReader reader) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) — End of inner exception stack trace — at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) at System.Web.Services.Description.ServiceDescription.Read(XmlReader reader, Boolean validate) at System.ServiceModel.Description.MetadataExchangeClient.MetadataRetriever.CreateMetadataSection(XmlReader reader, String sourceUrl) 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.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, Boolean enableProxyTypes, Assembly assembly) at Microsoft.Xrm.Sdk.Client.ServiceConfigurationFactory.CreateManagement[TService](Uri serviceUri, Boolean enableProxyTypes, Assembly assembly) at Microsoft.X

Has anyone else come across this error when integrating with Dynamics 365? Any help would be greatly appreciated!  

*This post is locked for comments

  • Saddamk206 Profile Picture
    Saddamk206 777 on at
    RE: 'Metadata contains a reference that cannot be resolved' error when integrating a Dynamics 365 client online

    Update Microsoft.Xrm.Sdk.dll

    OR

    Use this code above connection string

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

  • Suggested answer
    Nishant Rana Profile Picture
    Nishant Rana 55 Microsoft Employee on at
    RE: 'Metadata contains a reference that cannot be resolved' error when integrating a Dynamics 365 client online

    Refer the appropriate SDK assemblies. If you are targeting the latest version make sure you update the Nuget Package (Microsoft.CrmSdk.CoreAssemblies)

  • Suggested answer
    tw0sh3ds Profile Picture
    tw0sh3ds 5,600 on at
    RE: 'Metadata contains a reference that cannot be resolved' error when integrating a Dynamics 365 client online

    Hi,

    Are you using Microsoft.Xrm.Sdk.Client.dll? You should use Microsoft.Xrm.Sdk.Tooling.dll instead.

  • Suggested answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: 'Metadata contains a reference that cannot be resolved' error when integrating a Dynamics 365 client online

    Hi,

    Please go through the following discussions.

    social.microsoft.com/.../metadata-contains-a-reference-that-cannot-be-resolved-crm-2011

    github.com/.../1

    It shows the links about CRM 2011 but the error faced is the same. Go through the resolution of errors in the links below.

    working-with-crm.blogspot.in/.../metadata-contains-reference-that-cannot.html

    help.clickdimensions.com/error-metadata-contains-a-reference-that-cannot-be-resolved-crm-2011

  • Verified answer
    Nadeeja Bomiriya Profile Picture
    Nadeeja Bomiriya 6,804 on at
    RE: 'Metadata contains a reference that cannot be resolved' error when integrating a Dynamics 365 client online

    Hi Concep,

    You may need a newer version of the Microsoft.Xrm.Sdk.dll.

    https://community.dynamics.com/crm/f/117/t/184778?pi51685=2#responses

    Cheers,

    Nadeeja

    If the answer solves your problem, please mark as Verified. Thanks.

    My Blog: http://dyn365apps.com/ - Follow me on Twitter: https://twitter.com/dyn365apps

    LinkedIn: https://www.linkedin.com/in/nadeeja

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans