System.InvalidCastException: Unable to cast object of type ‘Microsoft.Xrm.Sdk.Entity’ to type

Hi,
 
Today suddenly all our plugins where we are using early binding thrown exception saying the below message.
 
Unable to cast object of type ‘Microsoft.Xrm.Sdk.Entity’ to type
 
After sometime, fixed the issue by adding the below line in AssemblyInfo.cs of the plugin project.
 

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


Hope this helps.
 

Happy CRM’ing

Gopinath

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s