Friday, 5 December 2014

Could not load file or assembly 'AjaxControlToolkit, Version=3.0.30930.28736, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I am working SP 2010 custom webpart, where I am using AjaxControlToolKit dll, I have added reference. When I build I am not getting any errors, after deploying while adding web part I am getting below error.

Could not load file or assembly 'AjaxControlToolkit, Version=3.0.30930.28736, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) 

Solution:

Download 'AjaxControlToolkit
You will get dll
Now add that dll to sharepoint server gac
To use gacutil on a development machine go to:
Start -> programs -> Microsoft Visual studio 2010 -> Visual Studio Tools -> Visual Studio Command Prompt (2010)

Then use these commands to uninstall and Reinstall respectively. Note I did NOT include .dll in the uninstall command.
gacutil /u myDLL

gacutil /i "C:\Program Files\Custom\AjaxControlToolkit.dll"