500.19 - Internal Server Error - The requested page cannot be accessed because the related configuration data for the page is invalid

C#asp.net Mvc-3Iis 7

C# Problem Overview


Before everyone reads this, I just want to say that i know that there are related threads out there, but I have either tried them or do not understand. With that being said here goes nothing...

I am trying to get a MVC Web App running in my IIS. Unfortunately, I am absolutely stuck on this error:

HTTP Error 500.19 - Internal Server Error

The Request page cannot be accessed becasue the related configuration data for 
the page is invalid.

Module: IIS Web Core
Notification: BeginRequest
Handler: Not yet determined
Error Code: 0x80070005
Config Error: Cannot read configuration file due to insufficient permissions
Config File: \foo\web.config
Request URL: http://localhost/WEBAPP
Logon Method: Not yet determined
Logon User: Not yet determined

Config Source
-1:
0:

I am not quite sure what else to do. I have also tried giving read permission to the web.config file and that did not seem to work.

If anyone has any information or would be able to help me work through this it would be much appreciated. Thanks!

C# Solutions


Solution 1 - C#

In my case I needed to install the IIS URL rewrite module 2.0 because it is being used in the web.config and this was the first time running site on new machine.

Solution 2 - C#

On this MSDN blog: Troubleshooting HTTP 500.19 Errors in IIS 7 in scenario 8 for error code 0x80070005 (E_ACCESSDENIED - General access denied error) it says:

> Grant Read permission to the IIS_IUSRS group ... > >.... the worker process identity (and/or the IIS_IUSRS group) needs at least Read access to the directory so that it can check for a web.config file in that directory.

Solution 3 - C#

Please follow these step

  1. Go to Control Panel
  2. Go to Programs and Features
  3. Turn Window Feature on or off
  4. Go to Internet Information Service node
  5. Follow World wide web Services
  6. Then Please Check Application Development Feature
  7. Then Please check all Node Specially Asp or Application Framework Like Asp.net 3.5 or ASP.NET 4.5 whatever you have

Solution 4 - C#

I fixed this by restarting VS.

I had opened a config file in another instance of VS and apparently sth went nuts...

Solution 5 - C#

[![Enable All Features under Application Development Features and Refresh the IIS ][1]][1]

Goto Windows Features on or Off . Enable All Features under Application Development Features and Refresh the IIS. Its Working [1]: https://i.stack.imgur.com/L5lQ2.png

Solution 6 - C#

I was trying to run a .net core 3.1 site from IIS 10 on windows 10 pro box, and got this error. Did the following to resolve it.

First turn on the following iis feature on.

Turn IIS Features on

Then follow the link below.

https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-3.1#install-the-net-core-hosting-bundle

Install the .net core hosting bundle.

The direct link is

https://dotnet.microsoft.com/download/dotnet-core/thank-you/runtime-aspnetcore-3.1.2-windows-hosting-bundle-installer

I have installed the .net core sdk and run time as well. But this did not resolve the issue.

What made the difference is the .net core hosting bundle.

Solution 7 - C#

I had a sub folder named web.config renaming this folder resolved the issue

Solution 8 - C#

My issue is that I accidentally installed another site as the default site instead of the IIS default (by opening another project.) I had to remove the default site and repoint it to the default location C:\inetpub\wwwroot using my domain login as the user to bypass with then just reopened my project that I was trying to run (the one showing this error) and it was all honky dorry

Solution 9 - C#

I was accessing the project from inside a Virtual Machine - sharing the project folder from the host OS (Windows 10). After trying many of the solutions, and even ensuring the permissions for the IIS_IUSRS are given, still I could solve this.

Eventually, I copied this folder from the host, onto a path on the guest OS, and now I can properly run that same ASP.NET project without ado. But, I did also go ahead and give the IIS_IUSRS group full control over this new dir as well... maybe that's not really necessary in this case? I'm lazy to test that ATM.

Solution 10 - C#

For completeness, the answer to https://stackoverflow.com/q/46603421/8145448 may also be the solution to the problem here. If the .NET Core Windows Server Hosting bundle is not installed then IIS cannot recognize the aspNetCore section in web.config. https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-3.1#install-the-net-core-hosting-bundle claims to be a direct download to the current version.

Solution 11 - C#

Delete .vs/Config folder => work for me

Solution 12 - C#

In my case I had .Net core SDK 3.1.403 was installed. So I installed the corresponding .Net Core Windows Server Hosting which is .NET core 3.1.9 - Windows Server Hosting.

Solution 13 - C#

I tried all solution above. My issue is resolved after reinstalling hosting bundle.

I installed hosting bundle before in IIS Manager installation.

I think this is caused error. Don't know why, but, the reinstallation works.

Solution 14 - C#

I had this problem to run restful service on IIS in Windows 10 and Windows Server 2019, finally after a lot of researches I solved the problem. After performing the following steps, the problem will most likely be solved.

  • Go to the "Windows Features" and active full features IIS ("Internet Information Services" or "Web Server") and active .Net Features

  • Locate the source at "C:\inetpub\wwwroot"

  • Open IIS

    • Click "Edit Permissions" on your web after go to the security tab and give full access to the IIS_IUSRS
    • Go to the "Application Pool" next right click on your app pool after click on "Advanced settings" and change "Identity" to "LocalSystem"
    • Go to the "Application Pool" next right click on your app pool after click on "Basic settings" and change ".NET CLR Version" to "No Managed Code"
    • If you want to set the service to a specific port, first set it to port 80 and then edit it and set your port
  • Well now if the problem is still not solved then install the following software on the system :

    • URL Rewrite 2
    • WebPlatform
    • DotNetCore.2.0.8 Windows-Hosting
    • Dotnet-hosting 5
    • Dotnet-runtime 5
    • MicrosoftServiceFabricSDK 5
    • NET.Framework 4.8

and finally restart the system.

Solution 15 - C#

If Folder getting from other, and host file is already generated on ProjectName\.vs\config folder, then it conflicts with a new one and gets this error.
So delete host file from ProjectName\.vs\config and restart project once again. It was worked for me

Solution 16 - C#

In my case, Server had lower version framework than your application. installed latest version framework and it fixed this issue.

Solution 17 - C#

In the Edit Application Pool window, set the .NET CLR version to No Managed Code

Solution 18 - C#

I had this error with Visual Studion 2019, my project was NopCommerce 4.30 which is an ASP.Net Core 3.1 project. I added page "gouden-munten-buitenland" to be the starting page and I only got the error when going to that page. Turned out that Visual Studio generated an invalid applicationHost.config :

<applicationPools>
    ....
    <add name="gouden-munten-buitenland AppPool" autoStart="true" />
    <add name="gouden-munten-buitenland AppPool 2" autoStart="true" /> <!-- WRONG -->
    <add name="Nop.Web AppPool" managedRuntimeVersion="" />
    <applicationPoolDefaults managedRuntimeVersion="v4.0">
	<processModel loadUserProfile="true" setProfileEnvironment="false" />
    </applicationPoolDefaults>
</applicationPools>

and

<sites>
    ....
    <site name="Nop.Web" id="2">
	...
	<application path="/gouden-munten-buitenland/gouden-munten-buitenland" applicationPool="gouden-munten-buitenland AppPool">
	    <virtualDirectory path="/" physicalPath="C:\Usr\Stephan\Wrk\Kevelam\kNop.430\Presentation\Nop.Web" />
	</application>
	<application path="/gouden-munten-buitenland" applicationPool="gouden-munten-buitenland AppPool 2">
	    <virtualDirectory path="/" physicalPath="C:\Usr\Stephan\Wrk\Kevelam\kNop.430\Presentation\Nop.Web" />
	</application> <!-- WRONG -->
	....
    </site>
    ...
</sites>

I removed the nodes identified as 'WRONG' and then it worked.

Solution 19 - C#

If your error is using a site in asp.net core, install the ASP.NET Core Windows hosting bundle.

  1. Click on the link below and select your .net core version
  2. In the following page find the link "Hosting bundle" (ctrl+f may help) and install it.

Worked a treat for me!

https://dotnet.microsoft.com/en-us/download/dotnet

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionscapegoat17View Question on Stackoverflow
Solution 1 - C#Josh DView Answer on Stackoverflow
Solution 2 - C#reneView Answer on Stackoverflow
Solution 3 - C#Amit YadavView Answer on Stackoverflow
Solution 4 - C#user2173353View Answer on Stackoverflow
Solution 5 - C#Aravind RengasamyView Answer on Stackoverflow
Solution 6 - C#VivekDevView Answer on Stackoverflow
Solution 7 - C#ThomasView Answer on Stackoverflow
Solution 8 - C#Serj SaganView Answer on Stackoverflow
Solution 9 - C#JWLView Answer on Stackoverflow
Solution 10 - C#SomeoneElseView Answer on Stackoverflow
Solution 11 - C#H u yView Answer on Stackoverflow
Solution 12 - C#Sunilkumar MandatiView Answer on Stackoverflow
Solution 13 - C#Nadir HashimovView Answer on Stackoverflow
Solution 14 - C#Masoud SiahkaliView Answer on Stackoverflow
Solution 15 - C#shruti ThakkerView Answer on Stackoverflow
Solution 16 - C#PMC KarurView Answer on Stackoverflow
Solution 17 - C#Mykhailo KiyanView Answer on Stackoverflow
Solution 18 - C#SteefView Answer on Stackoverflow
Solution 19 - C#dalcamView Answer on Stackoverflow