IIS 7的HttpHandler和HTTP错误500.21 [英] IIS 7, HttpHandler and HTTP Error 500.21

查看:387
本文介绍了IIS 7的HttpHandler和HTTP错误500.21的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在IIS 7,我想自定义的HttpHandler用我的ASP.NET Web应用程序。我使用的管道模式经典,.NET版本是4.0.30319,我的处理程序web.config配置是:

On IIS 7, I'm trying to use custom HttpHandler for my ASP.NET web application. I use pipeline mode "classic", .NET version is 4.0.30319, my web.config configuration for the handler is:

<system.webServer>
<handlers>
    <add name="MyHandler" path="*.myExtension" verb="*" type="Company.App.UI.Controls.MyHandler, Company.App.UI" resourceType="Unspecified" />
</handlers>
</system.webServer> 

当我调用这个处理程序中,我得到这个错误:

When I invoke this handler, I get this error:

HTTP Error 500.21 - Internal Server Error
Handler "MyHandler" has a bad module "ManagedPipelineHandler" in its module list

我做了谷歌搜索时,大多数人/修复重新注册ASP.NET这个问题由我的aspnet_regiis.exe命令,但这是的不可以我(命令完成工作,我重新启动IIS,但同样的错误)。我试图在两个不同的服务器,但得到了同样的结果。

I did a google search, the most of people fix this issue by re-registering ASP.NET by aspnet_regiis.exe /i command, but this is not working for me (the command finishes, I restart the IIS, but same error). I tried it on two different servers, but got the same result.

还有什么我应该尝试?谢谢

What else should I try? Thank you

推荐答案

这是不可能来配置IIS托管处理程序,在经典模式中运行。如果你想这样做,你应该运行在集成模式下IIS。

It's not possible to configure an IIS managed handler to run in classic mode. You should be running IIS in integrated mode if you want to do that.

您可以了解更多有关模块,处理并在以下博客文章IIS方式:

You can learn more about modules, handlers and IIS modes in the following blog post:

<一个href=\"http://blogs.msdn.com/b/tmarq/archive/2007/08/30/iis-7-0-asp-net-pipelines-modules-handlers-and-$p$pconditions.aspx\">IIS 7.0,ASP.NET,管道,模块,处理程序和preconditions

有关处理程序,如果在设置preCondition =integratedMode
   映射,处理程序将只在集成模式下运行。上
  另一方面,如果你设置preCondition =classicMode的处理程序将
  只有在经典模式中运行。 如果你省略这两个,处理程序
  可以在这两种模式下运行,尽管这是不可能的被管理
  处理器

For handlers, if you set preCondition="integratedMode" in the mapping, the handler will only run in integrated mode. On the other hand, if you set preCondition="classicMode" the handler will only run in classic mode. And if you omit both of these, the handler can run in both modes, although this is not possible for a managed handler.

这篇关于IIS 7的HttpHandler和HTTP错误500.21的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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