1

In Microsoft Dynamics CRM 2011, I wrote one plug-in in C# for Account entity to do some operations on fields when Account record is created. In C# code I created my own custom assembly called My.Custom.Assembly.dll. Which contains some generic methods those I can use often in my plug-in. And I using this My.Custom.Assembly.dll and also added in reference in my project.
Project builds successfully and plug-in registration also.
The problem I faced when I was creating a Account record. Its throwing an error: "Could not load file or assembly My.Custom.Assembly.dll, Version=1.0.0.0 Culture=neutral, PublicKeyToken=def751c98b41d765 or one of its dependencies.The System cannot find the file specified."
I got to know the problem is with My.Custom.Assembly.dll. Can you please help me to solve this problem..?

Charan Raju C R
  • 758
  • 5
  • 21
  • 43

2 Answers2

2

A good place to start debugging this type of issue is to use Fusion Log Viewer to see the details of how .Net runtime is attempting to load the assembly. http://msdn.microsoft.com/en-us/library/e74a18c4(v=VS.100).aspx

Based on what you find in the log post more details if you need additional assitance.

You may also want to read up on How .net loads Assemblies

Kerry H
  • 661
  • 5
  • 7
  • I'm not getting anything in that Fusion Log Viewer. If it works at run time it should not show anything. Because, we are building a solution in .Net frame work, but not running and taking that .dll file to CRM. – Charan Raju C R Dec 29 '11 at 14:36
  • How are you deploying the dll to CRM? – Kerry H Dec 29 '11 at 14:39
  • Since you are deploying to CRM here is an article on how that should be done from Microsoft. http://msdn.microsoft.com/en-us/library/gg309620.aspx#bkmk_deployment – Kerry H Dec 29 '11 at 15:02
  • No problem, if this (or ckellers post) helped to fix your problem, can you selected it as the answer. Thanks – Kerry H Dec 29 '11 at 15:26
  • I worked on both the suggestions. But I don't know whats the exact solution. I can't do any experiment now, to decide the answer. Any way u ppl helped me a lot. Thankful to both. – Charan Raju C R Dec 29 '11 at 15:38
  • @Charan then please give at least up votes for the answers ;) – ccellar Dec 29 '11 at 17:01
  • @ckeller: Hey sorry. Vote requires 15 reputation. But still I have 3 only.. :( – Charan Raju C R Dec 30 '11 at 04:07
  • @Charan sry, I didn't thought about that. I've voted on your questions. – ccellar Dec 30 '11 at 10:32
2

Your custom assembly cannot be loaded during the execution of your plugin. Either install it in the GAC or merge it with your plugin assembly.

See my answer at Plugin with references not working on CRM 2011

Community
  • 1
  • 1
ccellar
  • 10,326
  • 2
  • 38
  • 56