Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

INFO: Updating to a newer version of AjaxControlToolkit.dll
Roger Martin
#1 Posted : Monday, 13 December 2010 1:53:34 PM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,300
Location: Fort Atkinson, WI

GSP uses some clever AJAX functionality from the AJAX Control Toolkit. All versions of GSP (which, as of this writing is at version 2.4) ship with version 1.0.10920.0 of AjaxControlToolkit.dll. This is the newest version that can run under .NET 2.0. If you run your website under a more recent version of .NET, you may wish to use a newer version of the toolkit. Typically this will be the case when you are integrating GSP into an existing website that already uses a more recent toolkit.

If you try to use replace the AjaxControlToolkit.dll that ships with GSP with a different version, you will get this message:

Quote:
Error: Could not load file or assembly 'AjaxControlToolkit, Version=1.0.10920.32880, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.


This happens because GSP is compiled against a specific version of the toolkit, and because Microsoft strongly signed it (gee, thanks), .NET won't automatically use a different version. You need to do one of two things:

1. Re-compile GSP against the desired version of AjaxControlToolkit.dll.
2. Explicitly tell .NET to use the updated version. Do this by adding a bindingRedirect to web.config:

Code:
<configuration>
...
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" appliesTo="v2.0.50727">
<dependentAssembly>
<assemblyIdentity name="AjaxControlToolkit" publicKeyToken="28f01b0e84b6d53e" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="4.1.40412.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>


If your site is running under .NET 4.0, remove appliesTo="v2.0.50727".

The newVersion value should be the assembly version of the AjaxControlToolkit.dll you are using. If you are not sure what it is, use Reflector to inspect the DLL.

For many of you, the gallery will now work. But for those who have low karma points, you might get one of these messages:

Quote:
CS1705: Assembly 'AjaxControlToolkit, Version=3.5.40412.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' uses 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'


Quote:
Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.


These errors may occur under these circumstances:

1. Your web.config file references a different version of System.Web.Extensions than the version the toolkit was compiled against.
2. The toolkit DLL is compiled against .NET 4.0 and your IIS app pool is running under .NET 2.0.

To resolve these, make sure all your technologies are on the same .NET version - the IIS app pool, the web.config references, and the framework the toolkit DLL is compiled against.

Once your gallery is running, there is one more issue that may appear. This javascript error can occur when viewing a media object:

Quote:
AjaxControlToolkit is not defined


There can be many reasons for this, but the one I suspect is most likely is that you switched to a newer version of the toolkit, which caused this line of javascript to fail:

Code:
_fadeInMoAnimation = new AjaxControlToolkit.Animation.FadeInAnimation($get(_mo), {0}, 20, 0, 1, true);


The namespace for the FadeInAnimation class changed in later versions of the toolkit, so the line needs to be changed to this:

Code:
_fadeInMoAnimation = new Sys.Extended.UI.Animation.FadeInAnimation($get(_mo), {0}, 20, 0, 1, true);


To make the change, download the source code and open the file Website\gs\controls\mediaobjectview.ascx.cs. Look for the offending line and change it to the new syntax. Compile the application to generate a new GalleryServerPro.Web.dll, and copy it over the existing one in your bin directory.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
Rss Feed  Atom Feed
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.