Advertisements

Archive

Posts Tagged ‘Early Binding’

‘Xrm’ does not exist in namespace ‘Microsoft’ – Build error while referring CRM 2015 SDK Dll’s

I got below annoying build error while adding early binding class to my Plug-in Project and build.

XRM does not exist in namespace

XRM does not exist in namespace

It was bit strange as I already referred ‘Microsoft.XRM.SDK.dll’ from CRM 2015 SDK.

Reason :

  • CRM 2015 SDK has built on .Net 4.5.2 Framework and my Visual studio does not support 4.5.2

Fix:

Application Target Framework

Application Target Framework

🙂

Advertisements

Using CRM 2011 SOAP and REST endpoints with Silverlight

February 27, 2013 Leave a comment

To communicate with CRM 2011 from Silverlight application you can either use SOAP or REST endpoints.

URL’s for both endpoints will be available under “Developer Resources” section (Go to Settings -> Customizations -> Developer Resources)

SOAP and REST endpoints

SOAP and REST endpoints

Below are the important points on usage & limitations of both endpoints

Using REST endpoint with Silverlight

  • CRM 2011 uses the WCF Data Services framework to provide an OData endpoint that is a REST-based data service.
  • This endpoint is called the Organization Data Service
  • It supports early bound entity types so that the coding will be easy (i.e., you can instantiate contact c=new contact(); c.name=”Rajeev”)
  • Limitations
    • Only Create, Retrieve, Update, and Delete actions can be performed on entity records
    • You need to regenerate the proxy every time you change the entity schema (Ex – If you create a new entity or attribute)
    • You cannot use late binding to work with custom entities that were not included when proxy generated.
    • Here is the MSDN article Walkthrough REST in Silverlight

Using SOAP endpoint with Silverlight

🙂

“Object of type can not be converted to type ‘IBusinessEntity’ ” exception with crm Early Binding

December 28, 2011 3 comments

Hi,

You may come across below exception in Plug-Ins, while performing Create/Update operation  using CRM early binding

Exception: Unhandled Exception: System.InvalidOperationException: Object of type ‘entity_name‘ can not be converted to type ‘IBusinessEntity’

Fix :-

  • You need to add below line in your Plug-in project’s “AssemblyInfo.cs” file (Navigate to project folder and go to ..\Properties\AssemblyInfo.cs)

[assembly: Microsoft.Xrm.Sdk.Client.ProxyTypesAssemblyAttribute()]

AssemblyInfo.cs

AssemblyInfo.cs

  • Clean and Rebuild the solution
  • Register the plug-in assembly

Hope it helps 🙂