Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

Symptom

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.  

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'."

Or

"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=4.0.0.0, 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=4.0.0.0, 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)"

Or

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Unable to load the plugin type: PlugInName:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
  <ErrorCode>-2147204720</ErrorCode>
  <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
  <Message>Unable to load the plugin type: PlugInName</Message>
  <Timestamp>2012-08-20T17:12:52.9502027Z</Timestamp>
  <InnerFault i:nil="true" />
  <TraceText i:nil="true" />
</OrganizationServiceFault>



↑ Back to the top


Cause

This is caused by a corrupt web.config file.

↑ Back to the top


Resolution

Insert the section below to the CRM web.config file directly after the following tag: </system.diagnostics>

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

Add this section:


<runtime>

    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

      <dependentAssembly>

        <assemblyIdentity name="Microsoft.Crm.Sdk" publicKeyToken="31bf3856ad364e35" culture="neutral" />

        <bindingRedirect oldVersion="4.0.0.0-5.0.0.0" newVersion="5.0.0.0" />

      </dependentAssembly>

    </assemblyBinding> 

</runtime>




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

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

↑ Back to the top


Keywords: kb

↑ Back to the top

Article Info
Article ID : 2705840
Revision : 1
Created on : 1/7/2017
Published on : 10/12/2012
Exists online : False
Views : 191