Stunnware tools for CRM 2011 not working? The Plug-In FetchXML Wizard threw an exception: Could not load file or assembly 'Microsoft.Crm.Sdk, Version=5.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)

Downloaded the Stunnware tools for CRM 2011 and experiencing error below?

The Plug-In FetchXML Wizard threw an exception: Could not load file or assembly ‘Microsoft.Crm.Sdk, Version=5.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)

Stunnware Tools - CRM 2011 error screen

CRM 2011 supports backward compatibility by exposing support for the old SDK, it supplies its own version of Microsoft.Crm.Sdk.dll. The difference is that it is strongly signed with an updated version number of 5.0.0.0.

We can force the runtime to load our own supplied version of Microsoft.Crm.Sdk by overriding the publisher policy. This is done in App.config or Web.config for a web application (here SwTools.exe.config) using the following code:

<?xmlversion="1.0"encoding="UTF-8"?>
<configuration>
    ...
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.Crm.Sdk" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <publisherPolicy apply="no" />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>

Go to edit your SwTools.exe.config file and add <runtime>…</runtime> section from above code to the end of the config file before </configuration> tag. and Done!!