I recently need to register a custom HttpModule to intercept the mobile redirection feature. I followed this tutorial. At one point, I need to register my HttpModule in the web.config and put my DLL in the Bin.

1) Which web.config I need to add the HttpModule entry ? (

  • C:\inetpub\wwwroot\wss\VirtualDirectories\80\web.config or
  • C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\web.config

2) Which Bin folder do I need to add my DLL ?

  • C:\inetpub\wwwroot\wss\VirtualDirectories\80\_app_bin or
  • C:\inetpub\wwwroot\wss\VirtualDirectories\80\bin or
  • C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\BIN or
  • C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN

Now actually, I try them all and I still wasn't successful to register the HttpModule. Even after a IIS reset (iisreset). Does someone have a clue of what's wrong ?

  • 2
    I personally use the .browser method for publishing sites. I remove the redirects for mobile browsers. Therefore mobile browsers receive the full site. Then I use media queries in the CSS to make my pages look nice in mobile browsers. The biggest downside to this might be file size, but it does allow anonymous access, and will show all the webparts.
    – mcnarya
    Dec 13, 2011 at 18:04

3 Answers 3


1) register the HttpModule in the web.config for the Web application where you need it, in your case, C:\inetpub\wwwroot\wss\VirtualDirectories\80\web.config, use this page as a guide to how to register you HttpModule

2) You should sign the dll and deploy it to the GAC

3) You should really do this as Web Application scoped feature deployed in a WSP a using the SPWebConfigModification class, this will ensure that your dll is put into the GAC and that only the web.config for the target web applications (ie those which have the feature activated) are modified

  • I guess my problem was my DLL was not signed properly. And when it was, I was using httpModule section instead of modules Thanks to all ! Dec 15, 2011 at 19:00

1) C:\inetpub\wwwroot\wss\VirtualDirectories\80\web.config
2) C:\inetpub\wwwroot\wss\VirtualDirectories\80\bin

But it is considered better to sign the assembly and put it in GAC.


Are you sure, your site is running at port 80? It would be better to open up IIS manager and select the site that needs to bind the http module. On the right top side, you will see a link to click 'Explore'. Clicking on it, will open you the exact virtual directory of the site, where the web.config file is located. Moreover you will find there the site bin folder too.

As @justforkix09 suggested above, you can also sign the assembly and drag and drop the dll to GAC(C:\Windows\Assembly).

  • So basicly you both telling me that all I'm doing is fine and the HttpModule should register fine ? Dec 13, 2011 at 20:23
  • Is it working now?
    – Deepu Nair
    Dec 15, 2011 at 0:41
  • I'm still unable to register the HttpModule. I'm using IIS7.5 so I tryed <httpModule> and the new vesion <module> and still nothing. Maybe it's just not registering before the default httpModule. Dec 15, 2011 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.