Assembly Microsoft.Dynamics.Service.Plugins.dll can not be loaded. Dynamics CRM 365 Engine version 9 - CRM User creation error

Hello,

If You face an error while adding new user to the Dynamics CRM 365 onpremise for Version 9.0 stating that
"
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Assembly Microsoft.Dynamics.Service.Plugins.dll can not be loaded.
....
....
....

   <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">Microsoft.Crm.CrmException: Assembly Microsoft.Dynamics.Service.Plugins.dll can not be loaded. ---&gt; Microsoft.Crm.CrmException: Assembly Microsoft.Dynamics.Service.Plugins.dll can not be loaded. ---&gt; System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Program Files\Microsoft Dynamics CRM\server\bin\assembly\Microsoft.Dynamics.Service.Plugins.dll' or one of its dependencies. Access is denied.
....
....
....
"

It is about missing permission of assembly folder under <Dynamics CRM main folder>\bin.

Cause:
Dynamics CRM 9.0 engine comes with 14 libraries under "C:\Program Files\Microsoft Dynamics CRM\Server\bin\assembly"

...\Microsoft.Dynamics.AppCommon.Plugins.dll
...\Microsoft.Dynamics.CRMExtensions.Plugins.dll
...\Microsoft.Dynamics.LeadManagement.Plugins.dll
...\Microsoft.Dynamics.Marketing.Plugins.dll
...\Microsoft.Dynamics.Marketing.Workflows.dll
...\Microsoft.Dynamics.MarketingSales.Plugins.dll
...\Microsoft.Dynamics.ProductManagement.Plugins.dll
...\Microsoft.Dynamics.Sales.Plugins.dll
...\Microsoft.Dynamics.SalesService.Plugins.dll
...\Microsoft.Dynamics.SalesSMB.Plugins.dll
...\Microsoft.Dynamics.SalesUpgrade.Plugins.dll
...\Microsoft.Dynamics.Scheduling.Plugins.dll
...\Microsoft.Dynamics.Service.Plugins.dll
...\Microsoft.Dynamics.Service.Workflows.dll
so CRM Service account should have access rights to the libraries.

How to Fix:

We should set necessary permission of the Crm App Pool for the "C:\Program Files\Microsoft Dynamics CRM\Server\bin" and enable inheritence for "C:\Program Files\Microsoft Dynamics CRM\Server\bin\assembly" folder in order to reflect "bin" permissions underneath.



  • find service account of the Crm Application Pool from IIS

  • Right click to the assembly folder then click properties and go to Security tab and finally click Advanced.
  • Click "Enable Inheritence" and check "Replace all child object permission entries with inheritable permission entries from this object" after Apply and Ok

  • Add Crm App Pool account to the bin folder and set full access.

  • Finally IISreset 
Good luck...


Comments

  1. Worked for me thanks - saved me lots of time.

    ReplyDelete
    Replies
    1. what a good feeling to help you. Please spend "saved time" with your friends, family, relatives :)

      Delete
  2. Thank you somuch

    ReplyDelete

Post a comment

Popular posts from this blog

Exception caught instantiating TERADATA report server extension SQL Reporting Services

Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified at Configuration class initiation in CrmServiceHelper.cv