4

I have the ASP.NET 4 asmx web service (IIS 7.5). It works by https. I added ashx handler. It works locally, but do not work at the hosting. Return 500 Internal Server Error. What to do?

GePard
  • 51
  • 1
  • 7

2 Answers2

1

I encountered this problem when I changed the application pool in IIS from classic to integrated. I solved it by adding a handler to the system.webServer of the web.config file.

<add verb="*" path="*.ashx" name="ImageFromDB"  type="ImageFromDB" />


like this:

  <system.webServer>
    <handlers>
      <add verb="*" path="*.ashx" name="ImageFromDB"  type="ImageFromDB" />
    </handlers>
 </system.webServer>

This added 'ImageFromDB' to the HandlerMappings in IIS.

This link was very helpful in pointing me in the right direction.

0

ASP.Net will display a 500 if you don't have the customErrors property set to anything or it is set to On.

Add this to the web.config to see what the actual error is:

<customErrors mode="Off" />

Once you know what the actual error is, you can proceed to fix it.

Pranav Singh
  • 17,079
  • 30
  • 77
  • 104
Arun Singh
  • 63
  • 6