I have created a plugin and used a reference to another project (DLL) I have created. The problem is when I try to run the plugin, I get a CRM error saying:
I have a blog post here on how you can put it all in 1 DLL without ILMerge: All References within CRM2011 plugin. We've yet to have a dll issue since we started doing this.
NB this approach rules out the use of Sandboxed mode (i.e., you will not be able to use this approach should you require your plugin to work in Dynamics CRM Online).
Sometimes the Anti-Virus will prevent ASP.NET from accessing file or assembly, I suggest you try to sign the assembly with strong name and add it to GAC: Here you can find more information http://support.microsoft.com/kb/815808
We have had this error several times over the last 6 months and each time, despite me or the other developers swearing blind it would not be the case, it has turned out to be a DLL version problem.
Are you installing the plugin to disk, DB or GAC?
If installing to the GAC, I believe external DLLs go in the GAC as well. If installing to the DB or to disk, I believe DLLs go in the \assembly\bin folder.
You have to deploy the referenced assembly either to the GAC or merge it with your one (with ILMerge)
See also http://msdn.microsoft.com/en-us/library/gg309620.aspx and Creating a single CRM plugin DLL to store in the CRM database