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)

WCF Data Services does not compatible with Microsoft.Xrm.Client

(0) ShareShare
ReportReport
Posted on by

Hi, there is i guess a complete mess with Dynamics CRM Sdk and WCF Data Services.

Class Xrm generated by CrmSvcUtil.

We have this

class XrmServiceContext : Microsoft.Xrm.Client.CrmOrganizationServiceContext

but Microsoft.Xrm.Client in which CrmOrganizationServiceContext remains

has  reference to

System.Data.Services, Version=4.0.0.0

so when compiling I get

Error 56 The type 'System.Data.Services.IUpdatable' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. ... Xrm\Xrm.cs 321467 23 Xrm

Error 55 The type 'System.Data.Services.IExpandProvider' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. ... Xrm\Xrm.cs 321467 23 Xrm

Error 57 The type 'System.Data.Services.DataService`1<T0>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. ...\Xrm\Xrm.cs 328709 23 Xrm

As you can imagine The  Mess is complete!

Any one have a clear vision what I have to do ?

*This post is locked for comments

I have the same question (0)
  • ScottDurow Profile Picture
    21 on at

    Hi,

    You simply need to add a reference to System.Data.Services in your project.

    See the sample in the SDK for reference - msdn.microsoft.com/.../gg695790.aspx

    hth,

    Scott

  • Community Member Profile Picture
    on at

    Hi Scott

    as you can imagine things are not so obvious

    Error 127 The type 'System.Data.Services.IgnorePropertiesAttribute' exists in both 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.Services.dll' and 'c:\Program Files\Microsoft.Data.Services.5.6.0\lib\net40\Microsoft.Data.Services.dll' Xrm\Xrm.cs

  • ScottDurow Profile Picture
    21 on at

    So you seem to have references to the same assembly in two different versions of the .net framework. I suggest you remove both references to System.Data.Services and select only the version from the Assemblies ->Framework tab of the Add Reference dialog..Never browse directly for framework assemblies.

    hth

    Scott

  • Eduardo Bonato Profile Picture
    30 on at

    Just set the reference to the "old"  System.Data.Services.dll is the only available option.

    Currently, when you add a WCF DataService from VS 2012, it add references to the newest Microsoft.Data.Services.dll (fetching via Nuget  or you can get directly on www.microsoft.com/.../details.aspx)

    This new version of WCF Data service is compatible with OData V3 specs.

    Seems that current CRM SDK will not compile when using this new reference.

    Anyway, using this approach, you you fall in a poor experience when getting data from large entities, as you don't have control about what is exactly queried by CRM SDK.

    I would recommend, create you own model/controller classes, exposing your data via OData WebAPI, querying CRM only exactly what you need.

    blogs.msdn.com/.../getting-started-with-asp-net-webapi-odata-in-3-simple-steps.aspx

    www.asp.net/.../creating-an-odata-endpoint

  • Community Member Profile Picture
    on at

    hi Dian, How did you end up resolving the issue?

    Harihar

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