English

How To: Make the latest version of AjaxControlToolkit work with Web ADF controls

Summary

Instructions provided describe how to make the latest version of AjaxControlToolkit work with Web ADF controls.

When ArcGIS Server .NET is installed, the AjaxControlToolkit version 1.0.10920.32880 is registered into Global Assembly Cache (GAC); however, since the AjaxControlToolkit project is an open-source project new versions of the toolkit will be continually released. The latest version of the toolkit is AjaxControlToolkit 3.0.20229.20843. Although having the latest version of the AjaxControlToolkit is not necessary to work with WebADF controls, it can be downloaded at the following link: AjaxControlToolkit download.

If any ESRI Web ADF control is added to the Web page built upon the latest version of the AjaxControlToolKit (currently, version 3.0.20229.20843), a compile error similar to the following will occur:

"The type 'AjaxControlToolkit.HoverMenuExtender' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\AjaxControlToolkit\3.0.20229.20843__28f01b0e84b6d53e\AjaxControlToolkit.dll' and 'c:\WINDOWS\assembly\GAC_MSIL\AjaxControlToolkit\1.0.10920.32880__28f01b0e84b6d53e\AjaxControlToolkit.dll'"

The reason that this compile error occurs is that ESRI Web ADF controls require a reference to the older version of the AjaxControlToolKit, which adds the following item into web.config file:

Code:
<add assembly="AjaxControlToolkit, Version=1.0.10920.32880, Culture=neutral, PublicKeyToken=28F01B0E84B6D53E"/>


Since both versions are referenced, it causes the ambiguous problem.

Procedure

.NET Framework provides a method to redirect the assembly at runtime. In order to resolve the issue, add the following code into web.config file as a sibling tag of <system.web>.


Code:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="AjaxControlToolkit" publicKeyToken="28F01B0E84B6D53E"/>
<bindingRedirect oldVersion="1.0.10920.32880" newVersion="3.0.20229.20843"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

Related Information