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!
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")