If you are testing an ASP.NET website locally and suffer 500 Internal Server Error unexpectedly, what you are going to do in this case? Since 500 Internal Server Error commonly happens to websites developed in ASP.NET environment, we list several possible causes and corresponding solutions in this guide for unexpected needs.
When this error happens to your website, there must be something wrong with the server and that will result in request completion failure. Keep calm if you have suffered the 500 Internal Server Error on your ASP.NET based site and read through all solutions shown as below to check if there is something helpful.
Troubleshoot Possible Causes
This common issue currently occurs in the site deployed on IIS server. Perhaps, the main reasons to such an embarrassing situation are invalid script mapping, invalid ISAPI filter, nonsupport of Internal Server API, etc. To figure out the principal cause to 500 Internal Server Error, you should do it by means of IE browser and that has the ability to block detailed error information.
As thus, start with some basic settings for IE browser so as to reveal the primary cause to this issue. Open your IE browser and click Tools icon on the top right corner. Click Internet Options and then here comes a popup including various options. Go to “Advanced” tab and scroll down to the Browsing mode. Search and uncheck the option “Show friendly HTTP error messages”.
Confirm the settings by clicking “OK” button and then go back to the web page that shows you 500 Internal Server Error message. Reload it to get more messages for that error. Since the error details may differ from site to site, we list various situations possible to occur as below.
Possible Error Codes & Solutions
After troubleshooting 500 Internal Server Error via IE Internet Explorer, you may get a result included in the following list. Each error code refers to a problem to be solved.
Error Code 1 – HRESULT: 0x8007007f
This problem happens when the handler mapping cannot process the request pointing to the .dll file. A DLL file, short for Dynamic Link Library, is used to collect multiple small programs and that receives requests from an active executable program, like handler mapping. Since the .dll file can no longer being called upon by the handler mapping, there might be something wrong with the resource you search for.
Solutions: Recover the requested resource to DLL file from handler mapping that is the unique resolution is that case. Go to Start menu > All Programs > Accessories > Run and a box called Open requires you to enter inetmgr.exe in the field. And then, click “OK” to access to the IIS Manager.
Expand the server name and go to Web Sites > Website to be Modified. Click Handler Mapping that is included in Feature View. Edit a script mapping as planned by right clicking this item and access to the Edit Script Map box. Select a executable file from Executable section and confirm it by clicking “OK”.
Error Code 2 – HRESULT: 0×80070035
When an internal server error has been occurred, the page shows you the code HRESULT: 0×80070035 instead of the content you are looking for. That happens if the sever that IIS runs on cannot target the requested location the configured root directory belong to. It is one of the most common situations causing ASP.NET 500 Internal Server Error.
Solution: It is easy to solve only if you check the server frequently and ensure the normal access to configured root directory.
Error Code 3 – HRESULT: 0x800700c1
When this error happens, it is followed by an explanation of “The page cannot be displayed because an internal server error has occurred”, and that is just like the error code HRESULT: 0×80070035. The principal cause to this error is an invalid script mapping. Follow a simple guide as below to the point.
Solution: Expand the Start menu and target All Programs > Accessories > Run. Type inetmgr.exe and click “OK” to enter IIS Manager. Here, we are going to find out the ISAPI.dll file and make the script mapping point to this file correctly. Go to Web Sites > Website to be Modified and open Handler Mappings setting page via Features View. Edit the script mapping and make sure that it is pointed to an ISAPI.dll file correctly.
Error Code 4 – HRESULT: 0x80070005
This error message comes out when an invalid ISAPI filter loads at the Web site level or global level. In some cases, the error message is said “Description of HRESULT LoadLibraryEx on ISAPI filter ‘path_of_isapi’ failed”.
Solution: Expand the Start menu and go to All Programs > Accessories > Run box. And then, type inetmgr.exe in the field upon clicking “OK” button and come to IIS Manager. Expand your server name > Web Sites > Website to be Modified. Turn to Feature View and open the ISAPI Filers. Target the ISAPI filter to be removed and right-click it to “Remove” it.
In addition to the causes mentioned above, there are some other possible problems commonly happening to you, like HRESULT: 0x8007000d and HRESULT: 0x80070032. The way to solve those issues is similar to the solutions shown in this guide. We hope that this guide can help you settle a matter with ease and also suggest you to check all related settings regularly to prepare in advance.