ASHX 500 Handler Return Internal Server Error

I have an ASP.NET 4 asmx web service (IIS 7.5). It works https. I added an ashx handler. It works locally, but does not work on hosting. Return 500 Internal server error. What to do?

+4
source share
2 answers

ASP.Net will display 500 if you do not have the customErrors property set to everything, or it is set to On .

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

 <customErrors mode="Off" /> 

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

0
source

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

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


eg:

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

This added 'ImageFromDB' to HandlerMappings in IIS.

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

+1
source

Source: https://habr.com/ru/post/1484635/


All Articles