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 365 | Integration, Dataverse...
Suggested Answer

XrmServiceContext.Create

(0) ShareShare
ReportReport
Posted on by 515

Hi

I'm currently upgrading to 8.2 from an earlier version. (the business wants it to be 8.2)

I'm getting an error on XrmServiceContext.Create(entity).

I'm guessing this has been superseded by something else.

Can anyone let me know what I should be looking for?

I'm also having difficulty with update and a couple of other methods.

Thanks
Lee

I have the same question (0)
  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Error log could be helpful in this case.

  • Lee-Martin Profile Picture
    515 on at

    It's a compile error in visual studio

    pastedimage1620384676041v1.png

  • Lee-Martin Profile Picture
    515 on at

    the line turns out to be code we've (someone else in the team) written, it was difficult to drill down to it, but managed to find it after a search.

    Still no idea what the error is though

  • Suggested answer
    Torrado Profile Picture
    1,270 on at

    Hello,

    It seems that you have something really old as part of your code.

    Something there is referring to a class with namespace XrmServiceContext that is not part of the project, the reference is not added to the class where is being called, or doesn't contain a method for "Create".

    Since you are upgrading to Dynamics 365, I would suggest you to use the Dynamics 365 Web API or Organization Service when performing code operations in Dynamics 365.

    Please also check these official articles, they can guide you on how to rebuild your code:

    Hope this helps you.

    Please mark the answer as verified if helpful. That will help others in future.

  • Lee-Martin Profile Picture
    515 on at

    Yes, the code is old as it is an upgrade to 8.2 from an older version (6.0 I believe)

  • Torrado Profile Picture
    1,270 on at

    Then, I would suggest you to rebuild the code to use the modern approaches for Dynamics 365.

    Check the articles that I referred above, and please mark the answer as verified if you feel that is helpful. That will help others in future.

  • Lee-Martin Profile Picture
    515 on at

    Thank you but the code is not all mine, the xrm.cs file is being generated for me, and I am expected to use it.

    Is there anything available which directly helps me with the issue I am having?

    the code is using Microsoft.Xrm.Sdk.IOrganizationService

    but I cannot access .Create . Associate .Update etc...

  • Lee-Martin Profile Picture
    515 on at

    I've got the target framework as 4.7.2

    Could it be that I need to use an earlier framework for the 8.2 sdk?

  • Suggested answer
    meelamri Profile Picture
    13,216 User Group Leader on at

    Hi Lee,

    You should use 4.5.2

  • Lee-Martin Profile Picture
    515 on at
    Mehdi El Amri wrote the following post at 10 May 2021 2:38 AM:

    Hi Lee,

    You should use 4.5.2

    ---

    Thanks, changed it

    Unfortunately it's still not solved the issue :(

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 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 51 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 38 Super User 2025 Season 2

#3
#ManoVerse Profile Picture

#ManoVerse 31

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans