Problem Loading the Ninject Assembly


When installing the Coveo for Sitecore package or accessing your Sitecore instance, you might get the following error:

System.IO.FileLoadException: Could not load file or assembly 'Ninject' or one of its dependencies. The located assembly's manifest definition doesn't match the assembly reference. (Exception from HRESULT: 0x80131040)


This issue arises when you already have the Ninject library on your website. Upon installing the Coveo for Sitecore package, you will be prompted to overwrite your existing Ninject.dll file. If you choose to overwrite it, Ninject version will be deployed instead of your current Ninject library, therefore resulting in incorrect version numbers in your C# project references.


To fix this issue, follow these steps:

  1. Replace the Ninject.dll assembly in your website bin directory with the one referenced by your project.
  2. Using a text editor, open the web.config file and insert the following lines in the assemblyBinding XML element:

       <assemblyIdentity name="Ninject" publicKeyToken="c7192dc5380945e7" culture="neutral" />
       <bindingRedirect oldVersion="" newVersion="<YOUR_NINJECT_VERSION>" />
  3. Re-install the Coveo for Sitecore package, but when prompted to overwrite the Ninject.dll file, choose No. For all the other assemblies, you should choose Yes.

  4. Restart the Sitecore client and server when prompted.