The issue “HTTP Error 500.19 – Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid” is the most common error, but there is a simple way to fix this issue in most cases. One common way to fix I already shared in one of my previous article.
In this article, I am going to give one more simplest way to solve this error. But this solution may work in some cases and may not work in some cases. As its a most common issue in .NET or .NET Core or .NET 5 and especially when running a project in Visual Studio.
When we try to run the ASP.NET web application project in Visual Studio, after building the application successfully, the application will open in the web browser with the error “HTTP Error 500.19 – Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid” as shown in below screenshot:
The solution for the above issue is very simple in my case, I had to delete .vs folder which will be present in my root folder of the project. After deleting .vs folder, the error HTTP Error 500.19 was solved automatically. We don’t need to analyze more here as this issue is mostly related to visual studio and hopefully Microsoft will resolve this issue with the upcoming visual studio version.
The above solution is one of the easy and common way to fix the issue if nothing wrong in the application config file (web.config). If the above solution did not work for you, please try to resolve if there are any issues in web.config file.
The issue HTTP Error 500.19 looks so confusing and most common, but if there are no real problems with the application configuration file (web.config), then restarting visual studio or deleting .vs folder should solve the issue. Otherwise, it must be configuration issue.