1

I have an ASP.NET http module that adds a Response Filter and does some changes to the outgoing HTML based on a regular expression. The other day I noticed it doesn't seem to be working correctly anymore. Upon inspection I noticed that the Write method never gets called.

I believe this started happening after we moved over to .NET 4.0 / IIS 7.5 (from 3.5 / IIS 6) and we now use Integrated mode.

The response filter gets added in the BeginRequest event of the IHttpModule...

context.Response.Filter = new FormActionFilter(context.Response.Filter);

I did see that the Response Filter's Flush and Close methods get called but my breakpoints in Write were never hit.

Anyone else experience this issue or have any insights on why this happens?

Tim
  • 28,212
  • 8
  • 63
  • 76
Denny Ferrassoli
  • 1,763
  • 3
  • 21
  • 40

1 Answers1

1

The http module section in the web.config has changed in iis 7 from iis6. It should be under System.WebServer instead of system.Web -> httpModules. Have you already made this change?

 <system.webServer>
       <modules>
             <add name="YourModuleName" type="YourNamespace.YourModuleClassName,YourAssemblyName"/>
    </modules>
coder net
  • 3,447
  • 5
  • 31
  • 40
  • Yes I already have those changes. The Http Module runs fine in IIS7 and I am able to debug it. The real issue is that even though the Filter gets loaded, flushed and closed, the actual logic to modify the data is in the Filter's Write method and it doesn't get called for some reason. โ€“ Denny Ferrassoli Jul 18 '11 at 21:18
  • How about this link.. http://stackoverflow.com/questions/2474358/iis7-isapi-filter-module-httpmodule-events-how-do-they-line-up .. it seems that there are some changes in iis7. You might want to read on that. Not sure if its the same thing but looks similar. โ€“ coder net Jul 19 '11 at 13:47