Search code examples
dynamics-crmdynamics-crm-2011

Assembly paths for plugins, workflows, and supporting assemblies


So I've gotten this error message from time to time since working with MS CRM.

System.IO.FileNotFoundException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #C0916659

Since there are multiple places for DLLs to live it makes it a pain to maintain.

Here's what I know of so far.

CRM SERVER
c:\Program Files\Microsoft Dynamics CRM\Server\bin - ?
c:\Program Files\Microsoft Dynamics CRM\Server\bin\Assembly - Plugins
c:\Program Files\Microsoft Dynamics CRM\Server\CRMWeb\bin - Supporting DLLs for plugins

ASYNC SERVER
c:\Program Files\Microsoft Dynamics CRM\Server\bin\Assembly - Async workflows and plugins

What else am I missing or need to be corrected on how these paths work and their intended purpose.


Solution

  • Best practice is to register the assemblies to the database.

    Plug-ins not-registered in the sandbox can be stored in the Microsoft Dynamics CRM server's database or the on-disk file system. We strongly recommend that you store your production-ready plug-ins in the Microsoft Dynamics CRM database, instead of on-disk. Plug-ins stored in the database are automatically distributed across multiple Microsoft Dynamics CRM servers in a data center cluster. On-disk storage of plug-ins is useful for debugging plug-ins using Microsoft Visual Studio but is mostly provided for backward compatibility with callouts. You can debug a plug-in that is stored in the database.

    Plug-ins registered in the sandbox must be stored in the database regardless of the Microsoft Dynamics CRM deployment (on-premises, IFD/SPLA, or Online).

    This excerpt from the MSDN describes the registration possibilities and the paths.

    For on-premises or Internet-facing Microsoft Dynamics CRM installations, when you deploy plug-ins from another computer to the Microsoft Dynamics CRM server disk (on-disk deployment), the plug-in assembly must be manually copied to the server before registration. The assembly must be deployed to the \Program Files\Microsoft CRM\server\bin\assembly folder on each server where the plug-in is to execute.

    Plug-in registration should be done after the assembly has been copied to the …\bin\assembly folder on the server to prevent the situation where a system user causes an event in Microsoft Dynamics CRM to be raised but the registered plug-in assembly does not yet exist on the server. For server database deployment, the plug-in assembly is automatically copied during plug-in registration so that the earlier situation is not an issue.

    Depending on your plug-in’s design, your plug-ins may require other referenced assemblies to run. Regardless of whether you deploy your plug-in to the database or disk, if your plug-in requires other assemblies to run, you must put copies of these assemblies in the Global Assembly Cache (GAC) on each server where the plug-in is to execute. This does not apply to a Microsoft Dynamics CRM Online server because you do not have access to the GAC on that server.

    See Register and Deploy Plug-ins