简体   繁体   中英

httphandlers in azure 500 internal server error

I am not able to work with htpphandlers in azure after deploy, it is ok with in the local machine.

In web.config I declared as follows

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

In my handler.cs file i written as follows.

namespace WebRole1

{ public class Handle : IHttpHandler { #region IHttpHandler Members

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

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

}

In my local machine it is working fine. But after deploy to windows azure getting 500 internal server error.

I think your problem is related with having custom handlers in system.web instead of system.webserver.

Move your custom HTTP Handler to System.webserver as below:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM