88

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!

Lex Li
  • 60,503
  • 9
  • 116
  • 147
scapegoat17
  • 5,509
  • 14
  • 55
  • 90
  • 4
    I had the same problem in VS 2015 Community edition and fix it by restart VS. – HENG Vongkol Mar 31 '16 at 01:29
  • 1
    My problem solved by bellow post: http://stackoverflow.com/a/9239936/2155778 – Zolfaghari Jul 18 '16 at 09:14
  • @HENGVongkol Thank you for sharing your solution that worked for me after spending lots of time figuring out the cause of the issue. – nam Aug 02 '16 at 16:44
  • In my Case, issue while running locally, Control Panel -> Programs -> IIS Express -> repair, it will automatically reset IIS Express settings, that worked – Syed Mohamed Sep 22 '20 at 12:48

20 Answers20

137

This is a noise. It is only useful if you see error code 0x8007000d in the error page and you indeed have <rewrite> tag in the config file.

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.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
Josh D
  • 1,387
  • 2
  • 8
  • 2
37

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.

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
rene
  • 41,474
  • 78
  • 114
  • 152
  • 1
    And what if in thisIIS Ipm in, there is no IIS_IUSRS group? – Ricker Silva Mar 07 '14 at 14:44
  • You need to determine the identity of the worker process, aka the log on user that is in w3svc service – rene Mar 07 '14 at 15:08
  • Yes, I checked and as it is an IIS hosted web service, the user was the account assigned to the application Pool. As it was a testing server I went with LocalSystem – Ricker Silva Mar 07 '14 at 15:39
  • 2
    Note: I was settings the rights in the IIS-Manager by right clicking on the virtual directory and clicking Change Access Rights and it was still not working. After that I was checking the files within my web directory and it turned out every files access rights changed .... but web.config! I changed the rights on the web.config directly, now it works. – Martin Braun Jun 13 '14 at 06:21
21

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
Amit Yadav
  • 211
  • 2
  • 4
  • To be clear, which of "Then Please check all Node Specially Asp or Application Framework Like Asp.net 3.5 or ASP.NET 4.5 whatever you have " applies to the specific error message reported? Which actual ones are needed? If it depends on what I'm doing, how do I find out? – SomeoneElse Dec 18 '19 at 22:07
  • How to do this on Mac? – Ahmet Yılmaz Jul 02 '20 at 09:30
19

I fixed this by restarting VS.

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

user2173353
  • 4,316
  • 4
  • 47
  • 79
  • i just closed all the instances like restarting project, source tree, after then rebuilding, it's working fine on my end. – Rejwanul Reja Nov 26 '18 at 14:53
12

**Enable** All Features under **Application Development Features** and Refresh the **IIS**

Goto Windows Features on or Off . Enable All Features under Application Development Features and Refresh the IIS. Its Working

  • I don't think that turning ALL of these on is a good idea. I can imagine that if ASP.NET was turned off it could cause a problem, but I don't believe that e.g. "server side includes" is likely to be relevant. – SomeoneElse Dec 19 '19 at 01:17
  • For Windows Server 2012 and 2016: https://learn.microsoft.com/en-us/dynamics-nav/how-to--install-and-configure-internet-information-services-for-microsoft-dynamics-nav-web-client – Oranit Dar Jan 21 '21 at 12:21
3

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

Thomas
  • 31
  • 1
3

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://learn.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

The latest I guess should be here.

https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/#install-the-aspnet-core-modulehosting-bundle

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.

VivekDev
  • 20,868
  • 27
  • 132
  • 202
  • 1
    +1 I was immediately dismissive of what I judged to be a very basic and naive answer. Then I saw ".NET Core Hosting Bundle". Hang on - I didn't know there was a separate deployment for Windows Server hosting; I'd put the ASP .NET Core runtime there, but not this other core hosting package. FWIW - fixed my HTTP 500 in a quick double click - take heed. – Rab Sep 04 '20 at 11:17
  • this is solution Install the .net core hosting bundle. – hosam hemaily Mar 15 '21 at 11:17
  • Missing hosting bundle triggers `0x800700d`, not `0x80070005`. – Lex Li Aug 20 '23 at 04:46
1

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

Serj Sagan
  • 28,927
  • 17
  • 154
  • 183
1

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.

JWL
  • 13,591
  • 7
  • 57
  • 63
  • That's because when you were using mapped drives provided by the virtualization software (VMware for example) but IIS does not support mapped drives at all. – Lex Li Aug 20 '23 at 04:44
1

For completeness, the answer to Asp.Net Core tag in web.config causes failure 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://learn.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.

SomeoneElse
  • 360
  • 2
  • 12
  • That's not usually called "completeness". Missing hosting bundle clearly triggers `0x800700d`, which is different from the error code of this question. You are bringing confusion beginners, instead of completeness. – Lex Li Aug 20 '23 at 04:40
1

Delete .vs/Config folder => work for me

H u y
  • 11
  • 1
1

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.

  • 1
    I am having the same error when i try to deploy .net core 3.1 app on Windows server-2019 virtual machine. I hosted the website using azure devops deployment group. This is resolved for me after reinstalling hosting bundle for .net core 3.1 – karunakar bhogyari Jan 14 '22 at 14:00
  • Even if you installed hosting bundle before installing IIS, the error code should be `0x8007000d` (read the question carefully, as it was about `0x80070005`). – Lex Li Aug 20 '23 at 04:36
0

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

0

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

PMC Karur
  • 125
  • 2
  • 3
  • 10
0

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.

0

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.

Steef
  • 569
  • 5
  • 21
0

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.

Masoud Siahkali
  • 5,100
  • 1
  • 29
  • 18
  • Things like "change "Identity" to "LocalSystem"" are terrible ideas without web server security risks in mind. – Lex Li Aug 20 '23 at 04:33
0

One reason, for which I face this issue was a web.config file in Images folder (on abnormal location) and IIS was trying to allow the read rights according to incorrect settings in the web.config file.

Therefore make sure your build is correctly deployed without any abnormal files specially the configs one on invalid locaiton.

-1

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

-1

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

dalcam
  • 1,027
  • 11
  • 28
  • Read the error code please. `0x80070005` is clearly something else. – Lex Li Aug 20 '23 at 04:33
  • @Lex Li - if you dont have ASP.NET core installed correctly in IIS and your site is ASP.NET core you often get this error. I stand by my comment. – dalcam Aug 23 '23 at 22:24