Archive
‘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.
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:
- Download and Install NET Framework 4.5.2 Developer Pack
- Open your Plug-in project Properties from Visual Studio and set ‘Target Framework’ to 4.5.2.
🙂
Using CRM 2011 SOAP and REST endpoints with Silverlight
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)
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
- Unlike the REST endpoint, the SOAP endpoint uses the Organization service
- You can do all the operations with SOAP endpoint
- Here is the MSDN article Walkthrough SOAP in Silverlight
- SOAP does not provide early bound entity types natively but here is article to how to use early bindings with SOAP
🙂
“Object of type can not be converted to type ‘IBusinessEntity’ ” exception with crm Early Binding
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()]
- Clean and Rebuild the solution
- Register the plug-in assembly
Hope it helps 🙂