问题
I am using IIS6, I've written an HttpModule, and I get this error? After googling the web I find that this problem is caused by the .NET framework 3.5, so I put this on a machine where I didn't install .NET 3.5, but the problem is still there!
回答1:
My attempt at psychic debugging: you're using a statement like:
Response.Headers("X-Foo") = "bar"
If this is indeed the case, changing this as shown below will work around the problem:
Response.AddHeader("X-Foo", "bar")
回答2:
Only IIS7 supports the integrated pipeline. On IIS7 a HttpModule can participate in all requests coming to the web server not just those targeting specific file extensions.
II6 uses what IIS7 calls the classic pipeline where a HttpModules can only get involved once the earlier ISAPI based pipeline determines that the script mapping requires the request to handed over to ASP.NET.
回答3:
Just came across this problem. Using IIS6 and .NET 3.5. Fix for me was to use Response.AddHeader
instead of Response.Headers.Add
. HTH.
回答4:
Inspired by other answers, I've found that it's accessing the Response.Headers
object that causes the "operation requires IIS integrated pipeline mode" exception.
Avoid .Headers
and call other (older?) helper functions like:
Response.AddHeader()
andResponse.ClearHeaders()
(in my case!)
来源:https://stackoverflow.com/questions/186548/iis6-httpmodule-this-operation-requires-iis-integrated-pipeline-mode