【问题标题】:MSCaptcha Web.config httpHandler ErrorMSCaptcha Web.config httpHandler 错误
【发布时间】:2013-12-20 05:07:14
【问题描述】:

我想在我的项目中使用 Recaptcha,我的 web.config 文件中有以下问题。

<httpHandlers>
    <add verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha" />
</httpHandlers>
<pages>
    <controls>
        <add tagPrefix="cc1" assembly="MSCaptcha" namespace="MSCaptcha" />
    </controls>
</pages>

我的错误:

HTTP 错误 500.23 - 内部服务器错误

已检测到不适用于集成托管管道模式的 ASP.NET 设置。

最可能的原因:

此应用程序在 system.web/httpHandlers 部分定义配置。

【问题讨论】:

    标签: c# asp.net web-config recaptcha


    【解决方案1】:

    您似乎在 IIS 7.0 或更高版本上以集成模式运行应用程序。

    在集成模式下运行时,您应该像这样注册您的 HTTP 处理程序:

    <configuration>
      <system.web>
            ....
      </system.web>
      <system.webServer>
        <handlers>
    <add name="CAPTCHAHandler" verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha" />
        </handlers>
      </system.webServer>
    </configuration>
    

    问候, 乌罗斯

    【讨论】:

    • 配置源:10: 11: 12:
    • 配置源:10: 11: 12:
    • 将 system.webServer 元素放在 system.web 元素之外
    • 从 web.config 中删除 httpHandlers 元素并粘贴我在 之前建议的 system.webServer 元素,它必须工作。
    • 我也试过了,它对我有用,非常感谢。非常有帮助
    【解决方案2】:

    我可以解决您的问题: 你只需添加:

    <system.webServer>
        <handlers>
          <add name="CaptchaImage" verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha"/>
        </handlers>
      </system.webServer>
    <!--after or not in <system.web></system.web>-->

    `

    【讨论】:

      猜你喜欢
      • 2011-12-13
      • 2010-11-07
      • 1970-01-01
      • 1970-01-01
      • 2015-02-05
      • 2012-05-30
      • 1970-01-01
      • 2012-08-17
      • 1970-01-01
      相关资源
      最近更新 更多