Azure and HttpHandlers

若如初见. 提交于 2019-12-23 05:26:44

问题


I have a HttpHandler for an asp.net mvc application. I've tested the handler for asp.net and asp.net mvc 3 applications and everything works as expected.

When I use the HttpHandler in an Azure based asp.net mvc 3 application the 'ProcessRequest' method is NOT being called - I can see the HttpHandler being created.

I have the following web.config and this works for a standard asp.net mvc 3 app:

  <system.web>
    <httpHandlers>
      <add type="TestWebRole.Infrastructure.HttpHandlers.EPubHandler"
           path="*.epub"
           verb="*" />
    </httpHandlers>
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true" />
    <handlers>
      <add name="EPubHandler"
           type="TestWebRole.Infrastructure.HttpHandlers.EPubHandler"
           path="*.epub"
           verb="*"
           resourceType="Unspecified"
           allowPathInfo="false"
           modules="IsapiModule"
           scriptProcessor="%path%\aspnet_isapi.dll"/>
    </handlers>
  </system.webServer>

I also have the following statement in the global.asax.cs file to specify ignoring asp.net ,mvc routing for the extension type:

 routes.IgnoreRoute("{resource}.epub/{*pathInfo}");

What do I have to configure to get this working when running in Azure - locally or deployed into the cloud?


回答1:


Just to try, why don't you remove the httpHandlers section under system.web and leave only that in the system.webServer. And also strip all the unnecessary attributes from the one under system.webServer (scriptProcessor, modules, allowPathInfo).

And also you may check for any uncought exception, event log entry, anything showing some kind of error.



来源:https://stackoverflow.com/questions/8553526/azure-and-httphandlers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!