Thursday, June 14, 2007

Run MS ASP.NET AJAX Extensions from web site Bin directory

When you install the MS ASP.NET AJAX Extensions and create a new Ajax enabled web site, by default your web.config file is configured to run the MS AJAX Extensions from the GAC; where they were installed. However, you may want to run the extensions locally when you deploy your web site. Please follow the steps below to setup your web site to run the MS AJAX Extensions from the Bin folder of your web site.

1. Copy the MS AJAX Extensions assemblies to your Bin Directory. The path listed below is the default installation location for the AJAX Assemblies.

C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025
- System.Web.Extensions.Design.dll
- System.Web.Extensions.dll

2. Modify the <pages> section of web.config. You do not need to reference the assembly by version, culture and publickeytoken now since it will not be accessed from the GAC.

Before:

<pages>

<controls>

<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

controls>

pages>

After:

<pages>

<controls>

<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions"/>

controls>

pages>

3. Modify the <compilation> section of web.config removing the following entry from the <assemblies> node. This is what was telling your web to look in the GAC for the MS AJAX Extensions assembly.

<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

And that should do it. Now your site will reference the MS AJAX Extensions from the Bin directory of your web site and not from the GAC.

No comments: