【问题标题】:httphandlers in azure 500 internal server errorazure 500 内部服务器错误中的 httphandlers
【发布时间】:2012-05-24 10:02:56
【问题描述】:

部署后我无法在 azure 中使用 htpphandlers,在本地机器上可以。

在 web.config 中我声明如下

<system.web>
<httpHandlers>
  <add verb="*" path="*.cspx" type="WebRole1.Handle,WebRole1"/>
</httpHandlers>

在我的 handler.cs 文件中我写如下。

namespace WebRole1

{ 公共类句柄:IHttpHandler { #region IHttpHandler 成员

    bool IHttpHandler.IsReusable
    {
        get { return true; }
    }

    void IHttpHandler.ProcessRequest(HttpContext context)
    {
        context.Server.Transfer("Test.aspx", true);         
    }
    #endregion
}

}

在我的本地机器上工作正常。但是在部署到windows azure之后 500 内部服务器错误。

【问题讨论】:

    标签: azure ihttphandler azure-web-roles


    【解决方案1】:

    我认为您的问题与在 system.web 而不是 system.webserver 中使用自定义处理程序有关。

    将您的自定义 HTTP 处理程序移至 System.webserver,如下所示:

    <system.webserver>
     <httpHandlers>
      <add verb="*" path="*.cspx" type="WebRole1.Handle,WebRole1"/>
    </httpHandlers>
    <system.webserver>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-12
      • 2021-12-02
      • 2019-01-17
      • 2011-10-17
      • 2010-11-15
      相关资源
      最近更新 更多