Last post Mar 01, 2013 03:13 AM by subaganapathyraman
Feb 28, 2013 02:52 AM|subaganapathyraman|LINK
I wrote a custom HttpModule which must be run for all the Websites published in IIS
[assembly : AssemblyKeyFile (@C:\Windows\Microsoft.NET\FrameWork\v4.0.30319\HttpModule.snk”)]
Gacutil /I c:\Documents\Projects\HttpModuleLib\HttpModuleLib\bin\Debug\HttpModuleLib.dll
And it gave me the following message :
“Assembly successfully added to the cache”
type= “HttpModuleLib.CopyRightHttpModule, HttpModuleLib”/>
When I browse the website which I have published in IIS, I don’t see that it hits the HttpModule.
But when I place the dll in the bin folder of the published website and add reference to the HttpModule in the web.config file of the website, it works fine.
I wanted to run the HttpModule for all the Websites published under IIS. So wanted a global reference for my HttpModule. And I don’t want to refer the HttpModule in web.config file of every website.
Pls let me know whether what I have done is correct and where am I going wrong ?
Feb 28, 2013 04:18 AM|nilsan|LINK
Everything seems alright, you might want to check below link:
Feb 28, 2013 08:57 AM|subaganapathyraman|LINK
I guess u have taken my question differntly. The article you have suggested speaks about restricting the applications from inherting the root application's httpmodule reference.
But I want all the websites under the "Defalut Web Site" of IIS to hit my HttpModule. I wanted to give the reference to my HttpModule at a single place so that it can be referred by all the Web Sites. I dont want to give the HttpModule reference in the web.config
file of every website under "Default Web Site" root of IIS.
Say for example, if I have 10 websites published under "Default Web Site" of IIS, then all these 10 website's requests must be intercepted by my HttpModule. And one single config file to be maintained for all these 10 websites to specify the HttpModule reference.
Am I clear enough ?
Mar 01, 2013 03:09 AM|nilsan|LINK
Actually I got your point in the very first post. :)
Well it is an often forgotten configuration file called the machine.config file. This file is located in the %windir%\Microsoft.NET\Framework\Version\CONFIG directory. This is akin to the master control ro configuration file. The settings here affect all
ASP.Net applications running on the web server.
Make sure you've defined http module in that.
Mar 01, 2013 03:13 AM|subaganapathyraman|LINK
Thanks for ur reply. Let me try out this and get back to u :)