Microsoft Dynamics CRM 2011 Upgrade from RTM to UR6 breaks 4.0 plugins or workflow assemblies

This article provides a resolution for the corrupt web.config file that breaks 4.0 plugins or workflow assemblies when upgrading from Microsoft Dynamics CRM 2011 RTM to Update Rollup 6.

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


When upgrading from Microsoft Dynamics CRM 2011 RTM to Update Rollup 6 directly, then importing a Microsoft Dynamics CRM 4.0 database with plugins or workflow assemblies, a necessary section from the web.config may be removed.

You will receive errors such as:

System.InvalidCastException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #7A680103: System.InvalidCastException: Unable to cast object of type 'Publisher.Plugins.AutonumberPlugin' to type 'Microsoft.Crm.Sdk.IPlugin'.


Crm Exception: Message: Unable to load the plugin type: Publisher.Plugins.AutonumberPlugin+AccountCreate, ErrorCode: -2147204720, InnerException: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Crm.Sdk, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Microsoft.Crm.Sdk, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)
at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.Crm.Extensibility.PluginTypeFactory.LoadType(String qualifiedTypeName, Assembly assembly)


Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Unable to load the plugin type: PlugInName:
<OrganizationServiceFault xmlns:i="" xmlns="">
<ErrorDetails xmlns:d2p1="" />
<Message>Unable to load the plugin type: PlugInName
<InnerFault i:nil="true" />
<TraceText i:nil="true" />


This is caused by a corrupt web.config file.


Insert the section below to the Microsoft Dynamics CRM web.config file directly after the following tag:



The default location of the Microsoft Dynamics CRM web.config is C:\Program Files\Microsoft Dynamics CRM\CRMWeb or C:\inetpub\Microsoft Dynamics CRM\CRMWeb.

Add this section:

    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <assemblyIdentity name="Microsoft.Crm.Sdk" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="" newVersion="" />

If there is an empty runtime tag, remove it and replace with the new section.


It is recommended to do this after business hours, as it will recycle the CRMAppPool.