Getting AjaxPro to behave in the Global Assembly Cache (GAC)

Posted 08 November 2006, 23:52 | by | | Perma-link

Getting AjaxPro (CodePlex Start Kit) to behave in the Global Assembly Cache (GAC). While the means to do this are available in the Starter Kit, the "Quick Guide" doesn't really cover the main points here.

If you need to deploy AjaxPro to a web server via the GAC here are the key points to remember:

Modify your web.config as follows (this is for the .Net 1.1 version, for the .Net 2.0, just change "AjaxPro" to "AjaxPro.2"):

In configSections block add the following:

<sectionGroup name="ajaxNet">
    <section name="ajaxSettings"
             type="AjaxPro.AjaxSettingsSectionHandler,
                   AjaxPro,
                   Version=6.10.6.2,
                   Culture=neutral,
                   PublicKeyToken=4735ae9824c7d3ec" />
</sectionGroup>

Remember to update the version number to the version you are using - Michael Schwarz is quite prolific with his releases.

Then add the following as a direct child of configuration:

<ajaxNet>
    <ajaxSettings>
        <urlNamespaceMappings useAssemblyQualifiedName="true" allowListOnly="false" />
        <debug enabled="false" />
    </ajaxSettings>
</ajaxNet>

The key element here is the useAssemblyQualifiedName="true" attribute. This tells the AjaxPro library to output the calls to your AjaxMethods as fully qualified paths - with the version number, culture and public key information.

Finally, add the following block as a child of the system.web element:

<httpHandlers>
    <add verb="GET,POST"
         path="AjaxPro/*.ashx"
         type="AjaxPro.AjaxHandlerFactory,
               AjaxPro,
               Version=6.10.6.2,
               Culture=neutral,
               PublicKeyToken=4735ae9824c7d3ec"/>
</httpHandlers>

Again, updating the version number as required.

You can then follow the rest of the quick start guide to set up your first AjaxPro page.

I'm going to write up a note on error reporting tomorrow hopefully, but the key point here is you'll notice that I left in the Debug element in the ajaxNet section, set the value to true and you will be able to retrieve the stack, trace and lines from the exception as well as just the message.

Filed under: AJAX, ASP.NET, Fixes