Wednesday, December 1, 2010

Problem Accessing Dynamics CRM 2011 Beta services from BCS in Sharepoint 2010

Dynamics 2011 Beta exposes a new oData based service which can be used to pull data out from the system. I am working on BCS for Sharepoint 2010 for a simple demo and i decided to use this service to pull data from CRM 2011 beta system.
After setting the reference i tried to use the DataContext object to pull data out and got an exception which said
"Request version '1.0' is too low for the response. The lowest supported version is '2.0'."
On digging a little deep i realized that some header mismatch is happening between the oData service and my client.
MSDN social says that in order to change this header from 1.0 to 2.0 i need to target my assemblies to compile and run against .NET 4.0. To my utter surprise Sharepoint 2010 runtime can't load the assemblies which are targeted for 4.0 and hence i had to fall back on using the old way of accessing data from CRM which is using CRM data service. That's bad news as this means i will have to write lot of code which i could have done without.
The good thing though is that i will learn the old way of accessing data from the system. Will try to post some code samples.....

Regards, Abhishek

No comments: