Saturday, 7 September 2013

Different way to Register your Plugins in Database Instead of Disk/GAC



The 3 storage options are: 
           Database, Disk and GAC.
           The main differences between these are:
·    Database: The assembly dll is stored in the database, rather than the file system. Plug-ins stored in the database are automatically distributed across multiple Microsoft Dynamics CRM servers in a data center cluster.This is the preferred option in a production environment
·    Disk: The assembly dll is placed in the \server\bin\assembly directory on each server. You have to ensure the dll is placed in the correct place on all CRM servers, so the deployment overhead is a little greater in development environment. Also, if debugging, the assembly .pdb file needs to be placed in the same location; with this option it's easy to ensure the dll and pdb are from the same build
·    GAC: The assembly is placed in the Global Assembly Cache on each CRM server, and again you will have to do this. The GAC does allow multiple versions of an assembly, but CRM doesn't, so you don't really gain anything by using the GAC. I don't think I've ever used this option 

Advantage of Register your Plugins in Database

  1. Only database assemblies can be packaged in solutions
  2. Zero service interruption to update a database assembly
  3. Simplified organization backup / import.
  4. Disk assemblies will not support multiple versions
  5. With database assemblies another good thing is that they are all stored in a single place: the database. You don’t need to worry about deploying dll’s to file and GAC in multiple servers. If your CRM deployment is spread out in different server roles for load balancing, then you don’t have to worry about which roles will need your assemblies and on what servers you must deploy which assemblies 
    6.  Sandbox and CRM Online only support database assemblies