.NET Response.Filter不调用write()用IIS7 [英] .NET Response.Filter does not call Write() with IIS7

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

问题描述

我有一个.NET IHttpModule的,增加了响应滤波器,并做一些修改所需的文件。不过,虽然这通过Visual Studio的工作我不能得到通过IIS这项工作的工作。使用II7,V2.0.50727框架。

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.

响应过滤器获取的IHttpModule的的BeginRequest事件添加...

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;
}

我可以看到,响应滤波器的同花顺()和Close()方法被调用,但我在写断点()不被击中。

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?

我的web.config是正确设置注册类两种IIS7和Visual Studio(模块和放大器; HTTP模块等)

My web.config is correctly setup to register the modules for both IIS7 and Visual Studio (modules & httpmodule etc)

这也正是问题在这里找到 - <一个href="http://stackoverflow.com/questions/6737487/asp-net-response-filter-does-not-call-write">ASP.NET Response.Filter不调用write - 从我无法找到解决我的问题的答案

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.

推荐答案

如果任何人的兴趣,我发现这个问题。这是因为我一直试图处理,这不是注册为一个MIME类型文件扩展名。声明此MIME类型与IIS解决了问题。

If anyone's interested, I found the problem. It was because I has trying to handle a file extension that was not registered as a MIME-type. Declaring this MIME-type with IIS resolved the issue.

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

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