WebResource.axd not found error on azure appservice

1k Views Asked by At

When I migrated Asp.net webform (framework 4.7) website to azure I encountered 404 not found error for WebResource.axd files I have included the handler manually in web.config like the following

  <system.webServer>
    <handlers>
      <add name="AssemblyResourceLoader-Integrated-4.0" path="WebResource.axd" verb="GET,DEBUG" type="System.Web.Handlers.AssemblyResourceLoader" 
           preCondition="integratedMode" />
    </handlers>
  </system.webServer>

I also tried to configure handlers in system.web as well but with no luck.

  <system.web>
    <httpHandlers>
      <add   path="WebResource.axd" verb="GET,DEBUG" type="System.Web.Handlers.AssemblyResourceLoader"/>
    </httpHandlers>
  </system.web>

It only works when I deploy the site locally on IIS. Has anybody encountered this before?,Should I make any specific configuration in azure for that to work?

1

There are 1 best solutions below

1
Joey Cai On BEST ANSWER

Click your webapp in local and enter F4, in Properties,switched the managed pipeline mode from classic to integrated, that fix it.

Or you could add a handler at web.config:

<handlers>
  <add name="AXD-ISAPI-4.0_32bit" path="*.axd" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /> 
</handlers> 

Refer to this issue.