Unable to cast object of type Microsoft.Xrm.Sdk.Entity

Jan 10, 2012 at 3:59 AM

Hi,

While debugging using your tool i am getting this exception:

Unable to cast object of type Microsoft.Xrm.Sdk.Entity to type

I've even added this to the plugin assembly. but still cannot use early bound.

assembly: Microsoft.Xrm.Sdk.Client.ProxyTypesAssemblyAttribute

With out debugging it works.

 

May 21, 2012 at 11:44 AM
Edited May 21, 2012 at 11:44 AM

Hi,

I had the same issue.  Are you using types generated by crmsvcutil?  IF so, after creating MyServiceProvider(..) try calling:

 

provider.serviceFactory.service.EnableProxyTypes();

 

Hope this helps!

Alex