web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Unhandled Exception: System.InvalidOperationException: Metadata contains a reference that cannot be resolved

(0) ShareShare
ReportReport
Posted on by

Hi,  we recently upgraded to D365 from CRMonline.  We have an webapp that uses CRM webservices SDK to connect to D365 and create new contact and activity. It was working fine until recently that we get an error as below

It appears that we need to upgrade to latest D365 SDK.  Is there any way we can do the code upgrade via some tools? or what is the best way to upgrade.  Our app contains XRM.cs class as well. 

{"Metadata contains a reference that cannot be resolved: 'companyname.crm.dynamics.com/.../Organization.svc'."}

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Gopalan Bhuvanesh Profile Picture
    11,401 on at

    Hi

    If have not added new custom entities, custom fields then you do not need to generate XRM.cs class (early binding types).

    Did you refer the following article:

    rajeevpentyala.com/.../metadata-contains-a-reference-that-cannot-be-resolved

  • RollingStonzcrm Profile Picture
    on at

    Hi Gopalan,  yes. custom entities are used.  The app was working fine until recent update and its my understanding that some features have been depreciated. 

    my app.conf file 

     <microsoft.xrm.client>
        <contexts>
          <add name="Xrm" type="Xrm.XrmServiceContext, Xrm" connectionStringName="Xrm"/>
        </contexts>
      </microsoft.xrm.client>
      <connectionStrings>
        <add name="Xrm" connectionString="Url=company.crm.dynamics.com; Username=user1; Password=Password-1; authtype=Office365"/>
        
      </connectionStrings>


    The code that I used as below: 

    using (XrmServiceContext orgContext = new XrmServiceContext("Xrm"))
    {
    try
    
                    {
                        var monitor = (from m in orgContext.CreateQuery("custom_entity")
                                       select m).FirstOrDefault();
    }
    }


    From what I understand, I have to use Xrm.Tooling.Connector.CrmServiceClient so I am wondering how could I create the orgContext and leverage the Xrm.cs which is the file I generated for early bound.  In otherwords, what changes do I need to make at app.config file and for the code 

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans