在ASP.NET / IIS7使用gzip乱码的错误页面输出 [英] Garbled error page output using Gzip in ASP.NET / IIS7

查看:334
本文介绍了在ASP.NET / IIS7使用gzip乱码的错误页面输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实现里克·斯特劳的GZipEn $ C $我的网站上,它CPAGE 方法伟大工程的网站本身。然而,当我的code抛出一个异常的服务器错误页面看起来是这样的:

I've implemented Rick Strahl's GZipEncodePage method on my site and it works great for the site itself. However, when my code throws an exception the "Server Error" page looks something like this:

我试着在努力消除gzip的头,但无济于事挂钩到的Application_Error 。我怎么能在错误扭转gzip压缩?

I've tried to hooking into Application_Error in an effort to remove the GZip headers but to no avail. How I can reverse the GZipping on error?

推荐答案

我明白,这个问题实在是过时的。

I'm understand that this question is really outdated.

在从的Application_Error回应删除过滤器,这样

On Application_Error remove Filters from Response, like this

 protected void Application_Error(Object sender, EventArgs e)
 {
    HttpApplication app = sender as HttpApplication;
    app.Response.Filter = null;
 }

希望这可以帮助任何人。

Hope this helps anybody.

这篇关于在ASP.NET / IIS7使用gzip乱码的错误页面输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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