ASP.NET Response.Filter不调用write [英] ASP.NET Response.Filter does not call Write

查看:164
本文介绍了ASP.NET Response.Filter不调用write的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.NET HTTP模块,增加了一个响应滤波器,并做了一些修改的基础上定期EX pression即将离任的HTML。有一天,我发现它似乎并不再进行正常工作。经检查我注意到,在方式不会被调用。

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.

我相信这开始发生后,我们转移到了.NET 4.0 / IIS 7.5(3.5 / IIS 6)和我们现在使用的集成模式。

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.

该响应滤波器得到了IHttpModule的的BeginRequest事件添加...

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?

推荐答案

在web.config中的HTTP模块部分在IIS 7中发生了变化,从IIS6。它应该是System.WebServer代替的System.Web下 - >的HttpModules。你已经做出了这种变化?

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>

这篇关于ASP.NET Response.Filter不调用write的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆