Question

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 ?

Was it helpful?

Solution

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

OTHER TIPS

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).

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top