I have a simple HTTPModule which does some custom session state management.
public void Init(HttpApplication context)
{
context.AcquireRequestState += new EventHandler(ProcessBeginRequest);
ActivityLogger.LogInfo( DateTime.UtcNow.ToLongTimeString() + " In Init " + HttpContext.Current.Request.Url.AbsoluteUri);
}
and
public void ProcessBeginRequest(object sender, EventArgs e)
{
HttpApplication application = sender as HttpApplication;
ActivityLogger.LogInfo(DateTime.UtcNow.ToLongTimeString() + " In ProcessBeginRequest ");
if (application != null)
{
string requestURL = application.Context.Request.Url.ToString();
ActivityLogger.LogInfo(DateTime.UtcNow.ToLongTimeString() + " In ProcessBeginRequest " + requestURL);
}
return;
}
When I ran this code with breakpoints, I saw that this module got invoked even for static files like images,js and css. Has anyone experienced this ? I am thinking HTTP modules were only hooking on to events in the http pipeline for asp.net pages . Do they also hook on to static resources ? Or is it just with cassini ?
Environment: VS2008 - cassini server
PS: I did try it with Win2k8 IIS7 in our sandbox (kinda new), and tried to write it to a log file (as we do not have VS there),but could not write to the log file. Am sure its some write permissions issue. Can anyone point me to some resource which tells me how to set write permissions for directories when running ASP.net with IIS7 in W2k8
Edit1: I understand that using Integrated pipeline would extend the http pipelines for static and managed resources alike https://web.archive.org/web/20210612113955/https://aspnet.4guysfromrolla.com/articles/122408-1.aspx and http://learn.iis.net/page.aspx/243/aspnet-integration-with-iis7/
We are using classic pipeline in our prod. But still interested in knowing what other people have experienced.
Question2: Using IIS7 in integrated mode, will it decrease performance ? Say you have couple of modules hooking up with the pipeline, how much would be the performance impact? Would be nice if some one can point me to some baseline studies done for this.