0
votes

I wrote a plugin for Microsoft Dynamics CRM 2011. It runs alongside a bunch of other plugins written by different contractors targeting different versions of .NET.

My plugin targets .NET 4.5. I recently installed .NET 4.5 on the CRM web servers. If a user causes my plugin to fire (Create/Update of account), the plugin runs fine without any issues.

However, when an updates comes from a different plugin, the following error is thrown:

Method not found: 'System.Delegate System.Reflection.MethodInfo.CreateDelegate(System.Type)'

The limited stack trace we've received from the contractor reporting the error says it's occurring within my plugin. I am using Ninject, which I think is the likely culprit. I am guessing that somehow my plugin is being run in a .NET 4.0 environment where this method does not exist.

I am not very familiar with the way CRM runs plugins. Outside of the web servers, do I need to install .NET 4.5 on any other machines? Could this be related to a .NET 4.0 plugin indirectly calling my .NET 4.5 plugin?

2
can be (depends of which Ninject version you are using, I assume for .NET 4.5) target all to 4.0 (your plugin and the Ninject version)Guido Preite

2 Answers

0
votes

Even for crm-2013 Microsoft says that you should use .net 4.0. I think that you are right on the mark when you say that it's the interaction between 4.0 and 4.5 in your plugin. Can you build your project on 4.0? Give it a try and see what happens.

0
votes

After talking to the company about their CRM setup, they explained there were two servers dedicated to running async plugins. It appears that Microsoft Dynamics CRM always runs the plugins on whatever server initiated the update. Normally, that would be the web servers because the update is initiated by IIS. However, in this case, that would be the async servers. I simply had to install .NET 4.5 on these two servers and the problem went away.