Does BeginRequest and EndRequest for ASP.NET HttpApplication always occur in the same thread for a given HTTP request from a client?
I ask that I see very strange behavior when the ThreadStatic variable is not null inside the Init method for IHttpModule.
I set this ThreadStatic variable to BeginRequest and null to EndRequest.
However, my IHttpModule Init method should be called outside of the BeginRequest / EndRequest period, so the only way I can think that this ThreadStatic variable will matter when the Init method is called is if EndRequest occurs in a different thread than BeginRequest, and so thus, the value is still not null later when ASP.NET tries to use the same thread to create a new HttpApplication instance ...
I am running IIS 7 in integrated mode.
source
share