I have a .NET IHttpModule that adds a Response Filter and does some modifications to the requested file. However, while this works via Visual Studio I cannot get this work work via IIS. Using II7, v2.0.50727 framework.
The response filter gets added in the BeginRequest event of the IHttpModule...
context.Response.Filter = new myFilter(context);
which calls the following...
public myFilter(HttpContext myContext)
{
if (myContext.Response.Filter == null)
throw new ArgumentNullException("ResponseStream");
this._responseStream = myContext.Response.Filter;
_context = myContext;
}
I can see that the Response Filter's Flush() and Close() methods get called but my breakpoints in Write() are never hit.
Can anyone please help explain why Write() is not being called?
My web.config is correctly setup to register the modules for both IIS7 and Visual Studio (modules & httpmodule etc)
This is exactly problem found here - ASP.NET Response.Filter does not call Write - from which I could not find an answer that solved my problem.