Nov 22

First, if you”ve already installed the last version of the framework, you can relax since it will automatically put the ASP.NET AJAX assembly on the GAC.

Ok, if you”re still using ASP.NET 2.0, then keep reading. As we all know, ASP.NET AJAX was introduced as an add-in to the ASP.NET 2.0 platform. During the early CTPs, you used to put the dll inside the bin folder. However, when the 1st beta was released, the behavior changed: the installation package started putting the assembly on the GAC. At the time, many complained since most hosts would only install it after it went RTM.

Since this has happened a long time, I didn”t expect to keep seeing people recommending to put the ASP.NET AJAX assembly inside the bin folder of the web app (just to simplify deployment). People, this is not a good idea! If you take a look around,you”ll see that many hosting companies will let you run your app in medium trust (which,if you ask me, is a good idea). What this means is that, for instance, you won”t get any permissions to use reflection (here”s a good reference to see what happens in each trust level). And reflection is needed in certain areas of the ASP.NET AJAX platform. For instance, web service invocation needs reflection to get info about the methods that get added to the JS proxy that is inserted on the page. If you drop the assembly on the GAC (which is done by default by the installation package), the assembly will always run in full trust.

So, if you”re putting your ASP.NET AJAX assembly on the bin folder before deploying your app, you”re not really simplifying things; instead, you”re just being lucky because:

  • your web app hasn”t still used any feature that requires reflection. Who knows what will happen in the future when you decide to add a new feature?
  • you”re running your web app in full trust. Believe me: this is not also a good idea!

Moral of the story: the next time someone tells you to put the ASP.NET AJAX assembly on the bin folder, just say NO! 🙂

6 comments so far

  1. Buy Ambien
    2:06 am - 2-14-2010

    tusharec fairly immunization hardest comment americans informed ccccccfont noamount reandron supplying
    ambisoltersos makalavertonicos

  2. luis.maldonado
    12:46 am - 9-20-2010

    hello luis, why don”t you stop you bull,
    it”s great that you”re a genious, but the fact of the matter is you still DID NOT provide the answer as to what to do and how to find the ^%@$#^@^% modules everyone is looking for because only a select few twitts like you know where they are.

    going to the GAC with vs2010 to add a reference DOES NOT WORK. which is the reason people are PISSED and ANNOYED and frustrated and last thing we need is a %@#$%@$% SERMON…. GET IT…

  3. luisabreu
    7:33 am - 9-20-2010

    sorry luis, can”t understand a word of what you”re saying…

  4. brandon
    7:52 pm - 12-2-2010

    Luis, you”re completely missing the point that a DLL should be installed upon installation of this System.Web.Extensions (which anyone who has used javascript will confess that it”s a giant piece of crap anyway, however some douchebags noob programmers have in their projects so you are forced to get it so their crap will run) and in any case once a DLL is added you can manually add it to the GAC if you want.

    No installation procedure should EVER exclude the basics of having a DLL. This is a big fail on the part of MS.

  5. luisabreu
    9:01 pm - 12-2-2010

    Nop, Brandon, i believe you”re not getting it. this post is old…really old, like in 2007, when we”re having the first releases of ajax. at the time, not every ISP was installing it on their servers and that meant that there were people putting the ajax assembly inside their bin folders for deploying their web apps in machines where the ajax wasn”t installed. Unfortunately, there were some serioues implications and I”m simply alerting for some of those problems in this post.

    and that”s all there is to it. nothing more…nothing less…

    and yes, ajax isn”t as nifty as jquery, but it seems like some of their ideas are good and the proof is that they”ve been integrated into jquery (ex.: templates)

  6. Bhadri
    2:21 pm - 1-5-2011

    fantastic article about webextensions dll, it”s really worth reading before deploying the 2.0 ajax extensions 1.0.