1
votes

My company are in the process of upgrading to CRM 2013. We have a 2013 rig and a 2011 rig. During this process I have changed my Visual Studio instance to use the CRM 2013 SDK Developer Toolkit.

During this process I (foolishly) thought that the toolkit would be backwards compatible to deploy to 2011. Or at least throw an error and let me downgrade my toolkit and continue. How wrong I was. I tried to deploy with both versions of the toolkit and got the same error, extracted from the CRM logs on the frontend server:

System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Xrm.Sdk, Version=6.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.Xrm.Sdk, Version=6.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)

It's looking for version 6.0.0.0 (2013) of Microsoft.Xrm.Sdk.dll!

  • I've checked the project references in my projects - all point to version 5.x
  • I've chekced for all Microsoft.Xrm.Sdk.dll files in my code base - all are version 5.x
  • I've checked the web.config on the frontend box - all crm dll references are 5.x
  • I've checked all *.config files on the frontend box - no mention of version 6.0.0.0

I can get it to deploy by adding version 6.0.0.0 to the GAC but then the plugin fails (unsurprisingly) saying it cannot cast my plugin into type Microsot.Xrm.Sdk.IPlugin.

We are in the process of building another frontend server to see if that works (as I suspect it should). Is there an easier way to fix this? It looks like the 2013 Developer Toolkit has corrupted the 2011 frontend server somehow.

1

1 Answers

0
votes

Found the problem:

The plugin in question depends on another assembly that is part of our code base, uses the Microsoft.Xrm.Sdk.dll and is added to the GAC of the CRM box. This assembly was build with the 2013 SDKs and deployed to the GAC earlier on. This was what was causing the deployment to fail.

Solution: Rebuild this assembly and the plugin with the 2011 dlls and reinstall to the GAC and then redeploy to the plugin.

Be warned still.. the 2013 SDK developer toolkit is not backwards compatible to a 2011 deployment. It will assume to use the 2013 DLLs.