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 🙂

 

Advertisements
Advertisements

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

  1. MzM Avatar
    MzM

    Hi,
    I’m using genrated proxyclass (via CrmSvcUtil.exe) as linked dll. It works fine in plugin, but in workflow throws the same exeption mantioned above.

    plugin dll, workflow dll and dll containing proxy classes are in the same directory.

    Any suggetion?

    Thans

    Marek

  2. mathiyazhagan r Avatar

    Thanks a lot Rajeev Pentyala.
    You saved me

  3. Krish Avatar
    Krish

    Hi,
    Same error happens during workflow custom activity execution as well, though I added the assembly entry in workflow project as well.

Leave a comment