Plug-in execution causes System.TypeLoadException in Microsoft Dynamics CRM 2011

This article provides a resolution for the issue that you can't execute a plug-in in Microsoft Dynamics CRM 2011 due to a System.TypeLoadException error.

Applies to:   Microsoft Dynamics CRM 2011
Original KB number:   3055434

Symptoms

In Microsoft Dynamics CRM 2011, when you attempt to execute a plug-in, you receive the following error:

System.TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assemby 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

Cause

There is a mismatch in the .NET Framework versions between the computer the plug-in was developed on and the servers that host the Microsoft Dynamics CRM 2011 deployment. The computer that the plug-in was developed on has .NET Framework version 4.5 installed, while the servers that host the Microsoft Dynamics CRM 2011 deployment have .NET Framework 4.0 installed.

Resolution

To resolve this issue, the servers that host the Microsoft Dynamics CRM 2011 deployment need to have their .NET Framework upgraded to version 4.5. The link to download the .NET Framework version 4.5, along with installation instructions, is Microsoft .NET Framework 4.5.