HTTP 500: every web developer has faced this error at least once in his life, and today I want to tell my story…
A few days ago I was working on an ASP.NET WebForm application, which consistently showed the error HTTP 500 – Internal server error. Since IIS was configured not to show detailed errors, I didn’t have much information to get to the root of the problem.
Help came from the IIS Manager. Opening the application configuration in IIS Manager, an error similar to the one visible in the image below was returned:
It was evident that there was a problem in the configuration file. Looking at line 2 of the config file, there was just a comment something like the following:
At first sight, there was nothing wrong at it, but.. In italian it often happens to use accented letters, and therefore I had a doubt: what if it were an encoding problem?
I opened the web.config file with Notepad++ and in fact the problem was here:
Changing file encoding to UTF-8 and modifying the web.config (the letters were scrambled now…) the web site started working again.
Note that the HTTP 500 error can come up for various reasons and this is one of the many, but it was a subtle case and I wanted to share with you.
See you next time!