[英]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. 部署后,我无法在azure中与htpphandlers一起使用,可以在本地计算机中使用。
In web.config I declared as follows 在web.config中,我声明如下
<system.web>
<httpHandlers>
<add verb="*" path="*.cspx" type="WebRole1.Handle,WebRole1"/>
</httpHandlers>
In my handler.cs file i written as follows. 在我的handler.cs文件中,我编写如下。
namespace WebRole1
{ public class Handle : IHttpHandler { #region IHttpHandler Members {public class Handle:IHttpHandler {#region IHttpHandler成员
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. 但是部署到Windows Azure上后会出现500个内部服务器错误。
I think your problem is related with having custom handlers in system.web instead of system.webserver. 我认为您的问题与在system.web中而不是system.webserver中具有自定义处理程序有关。
Move your custom HTTP Handler to System.webserver as below: 将您的自定义HTTP处理程序移动到System.webserver,如下所示:
<system.webserver>
<httpHandlers>
<add verb="*" path="*.cspx" type="WebRole1.Handle,WebRole1"/>
</httpHandlers>
<system.webserver>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.