locked
Using 3rd party assembly in plugin throws error RRS feed

  • Question

  • Hi Everyone,

    I would like to use a 3rd party assembly in a plugin. One of my former colleagues started the project, and managed to set it up in the developer environment by adding the .dll file to the C:\Program Files\Microsoft Dynamics CRM\Server\bin\assembly folder. I deployed the solution to the production environment, but the plugin throws the following exception: Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly.

    The assembly is copied to the same folder in the prod environment, and I also set the security permissions to match the other .dll-s in the bin folder. I also made sure to unblock the dll file.

    Any ideas what could have gone wrong?

    Regards,

    Adam

    Thursday, March 5, 2015 8:20 AM

Answers

  • Thank you for the information. After checking the traces, it turned out CRM was looking for the assembly in CRMWeb\bin by default.

    • Marked as answer by Adam Borsik Monday, March 9, 2015 11:01 AM
    Monday, March 9, 2015 11:01 AM

All replies

  • Is the plugin assembly registered in the database, disk or GAC ? I'm not sure if it makes a difference, but try registering it on disk if it isn't already, then run IISReset to be sure the change has taken effect

    The other possibility is that the 3rd party assembly requires another assembly, and it is this other assembly that cannot be loaded. The Fusion log viewer should help identify the assembly that can't be loaded


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

    Thursday, March 5, 2015 9:03 AM
    Moderator
  • Hi David,

    Thank you for the response. Unfortunately Fusion log viewer did not to generate any output for me.

    I tried to register my assembly to disk. It worked fine for the development environment, but when I tried to import the managed solution to the prod environment, I received a generic "Unable to load plug-in assembly" error (I added the plugin dll file to the assembly folder on both machines). Using the plugin registration tool resulted in the same error.

    Regards,

    Adam

    Thursday, March 5, 2015 2:05 PM
  • Hi Adam,

    The third party dll needs to be added to the GAC folder...

    C:\Program Files\Microsoft Dynamics CRM\Server\bin\assembly  ... this is 4.0 style and best practice though. But going forward from 2011 this is not the must... ur assembly can be any where... in the drives. 


    Thanks & Regards Vijji

    Thursday, March 5, 2015 4:37 PM
  • Thank you for the information. After checking the traces, it turned out CRM was looking for the assembly in CRMWeb\bin by default.

    • Marked as answer by Adam Borsik Monday, March 9, 2015 11:01 AM
    Monday, March 9, 2015 11:01 AM