locked
CRM 2016 on premises plugin - 'Microsoft.Xrm.Client' not found RRS feed

  • Question

  • Hi

    I have a custom workflow step (Snadbox) plugin in which I want to clone related records of the primary workflow entity,

    but I get the error below when I run it.

    Could not load file or assembly 'Microsoft.Xrm.Client, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified

    Changed from Sandbox mode to None but error still present.

    Thank you

    Wednesday, July 20, 2016 1:56 PM

Answers

All replies

  • You cannot use 'Microsoft.Xrm.Client.dll for server side code. This DLL is meant for using outside CRM Server.

    If you are having On-premise CRM, then you can try adding this DLL to GAC of CRM Frontend as well as Backend server.

    Thanks


    MaKeer | myencounterwithcrm.wordpress.com | CRM2011 User Settings Utility | CRM2011 Lookup Preview | CRM2011 Lookup Attribute Mapping | CRM2011 TreeView Control (Beta) | CRM2011 N:N Entity View (Beta) | CRM 2011 Global Quick Search (Beta)

    • Marked as answer by _cram Thursday, July 21, 2016 4:23 PM
    Wednesday, July 20, 2016 8:50 PM
  • To expand on the previous answer, it is possible to use Microsoft.Xrm.Client in a plugin, but it is not recommended - instead you should use the IOrganizationService instance that you derive from the context passed to the plugin.

    I expect the source of your error is that the plugin was compiled with a reference to version 7 of the Microsoft.Xrm.Client assembly, whereas Crm 2016 has version 8


    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    • Proposed as answer by Makarand Keer Thursday, July 21, 2016 6:14 AM
    Thursday, July 21, 2016 5:51 AM
    Moderator
  • Hi

    Thank you for your responses.

    I have added the dll to the GAC done an IIS reset and also had to restart CRM services. No it works but only outside Snadbox which is still good.

    Thanks

    Thursday, July 21, 2016 4:23 PM