IIS 500.19 with 0x80070005 The requested page cannot be accessed because the related configuration data for the page is invalid error

521

I want to upload my own asp.net website on IIS with IIS Manager. But when I do this, I get the following error

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

Module IIS Web Core
Notification Unknown
Handler Not yet determined
Error Code 0x80070005
Config Error Cannot read configuration file due to insufficient permissions
Config File \\?\C:\Users\Yasso\Documents\Visual Studio 2008\WebSites\WebSite5\web.config

I searched many times for a solution for this error, but none of the solutions solved the error.

I have a problem with my IUSR account. I can't see this account in the "group or user names" in the properties of the web.config.

What is the problem?

asp.net
iis-7
iis-manager
asked on Stack Overflow Feb 9, 2012 by Yasmeen • edited Jun 22, 2020 by Lex Li

46 Answers

716

This can also happen if the site is configured to use the IIS URL Rewrite module but it is not installed.

answered on Stack Overflow Jan 21, 2013 by bkaid
461

Finally, I got the solution for my problem. The ASP.net account did not appear in the IIS manager, because I didn’t check its checkbox in IIS. To do this in Windows 7 follow the steps:

  1. Open control panel
  2. Click on “program” link (not uninstall programs)
  3. Click “turn windows features on/off” link
  4. Locate “Internet Information services IIS” in the pop up window and expand its node
  5. Expand the “World Wide Web Service” node
  6. Expand “Application Development Features” node
  7. Check the check box of “ASP.NET”
  8. Then click ok button

Now, you will see the ASP.net account on the IIS manager and by default you will see the IIS account. Now, you should move your ASP.net website from “my document” to another place where the IIS have permission to access it (i.e. to another partition on your computer). Now, browse your website from the IIS manager and it should work.

Thanks a lot for Jeff Turner for the solution.

answered on Stack Overflow Feb 11, 2012 by Yasmeen • edited Jan 9, 2019 by Martin Braun
194

The message is saying that your configuration file is corrupt in some way. However it also says that it can't actually access the config file. So I'd ignore the original message about corruption/lack of validity as this is most likely just the effect of not being able to read the file due to a lack of authorization.

The reason it cannot read the config file is because the process running your web app does not have permission to access the file/directory. So you need to give the process running your web app those permissions.

The access rights should be fairly straightforward, i.e. at least Read, and, depending on your app, maybe Write.

Above, you mention IUSR etc. not being in the properties for web.config. If by that you mean that IUSR is not listed in the security tab of the file then it's a good thing. One doesn't want to give IUSR any kind of permission to web.config. The role IUSR is an anonymous internet user.

The file web.config should only be accessible through your application.

The problem is you haven't said which OS and IIS version you are using so it's difficult to advise which steps to take.

I.e. in IIS 7.5, the error message you're quoting is likely to occur due to your ApplicationPoolIdentity not being assigned the permissions. Your web application belongs to an application pool and so you need to give the permissions to the OS account that your web application's application pool runs under. Often this is something like NetworkService but you may have customized it to run under a purpose made account. Without more info it's difficult to help you.

answered on Stack Overflow May 13, 2012 by intermension • edited Nov 16, 2012 by Konrad Viltersten
54

I was having the same problem, here is the solution that worked for me.

  1. IIS Manager
  2. Right clicked on that Website
  3. Edit Permissions
  4. Added user 'IIS_IUSRS' from Security tab
  5. Gave full permissions to User 'IIS_IUSRS'
  6. Set the Application Pool's Identity to 'ApplicationPoolIdentity'
answered on Stack Overflow Jan 23, 2014 by Sukhdevsinh Zala • edited Mar 26, 2018 by John
39

For Visual Studio (VS) developers: As hinted at by Harvey Darvey, Savage, and Snives, your Application Host Configuration may be pointing to the wrong application physical path. Search for virtualDirectory within /.vs/config/applicationhost.config to change the physicalPath if it is incorrect.

enter image description here

Make sure the physicalPath is correct:

enter image description here

answered on Stack Overflow Sep 10, 2016 by Michael
25

Facepalm alert:

You will also get this error if the path to the config file is wrong. Double-check it to make sure the physical path is entered correctly in IIS.

answered on Stack Overflow Sep 19, 2013 by Jon Crowell • edited Sep 20, 2013 by Jon Crowell
20

Just to chip in, I received the same kind of error and my problem was quite simple: I was missing the .NET Core Hosting Bundle. Once I installed the tool and restarted the server, it was fine.

You can find the manual to host asp.net core on windows here: https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.2

answered on Stack Overflow Jan 21, 2019 by JS_Diver
19

You need to assign permissions for IIS_IUSRS on the local machine (but you don't have to assign for IUSR, in fact it will work even if you explicitly deny permissions).

To assign permissions, just right click on the folder and on the security tab make sure to grant the correct permissions, and if the user is not listed then click "ADD", and enter IIS_IUSRS (and make sure that under "domain" the local computer is selected, or enter in the name field YourLocalComputerName\IIS_IUSRS), and then you are good to go.

If you want you can instead of assigning permissions to the IIS_IUSRS group, you can instead assign to the app pool which should in general be "IIS APPPOOL\ app pool name".

answered on Stack Overflow Aug 14, 2012 by yoel halb
11

The same thing happened with me , Try checking this by double clicking on the Connection strings on the right pane of IIS 7 when you select a website.

It will give you an error (that there is some problem with web config file), because you have used URL rewrite rules and the respective component is not installed.

Install “Microsoft URL Rewrite Module 2.0 for IIS 7” and this should fix your problem

answered on Stack Overflow Sep 18, 2013 by Tanuj Gulati
10

Nothing here worked for me, I found this command in another SO answer though and it solved my problem. Just start command prompt as an administrator and run this command:

run->cmd

run "c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i"

Credit: User Vicxx

answered on Stack Overflow Feb 20, 2015 by Celt
7

Make sure you have the application pool set to the correct version of the framework. You'll also need to make sure your aspnet, IIS_IUSRS, or IUSR users have read access to the application's directory.

answered on Stack Overflow Feb 9, 2012 by Jeff Turner • edited Mar 7, 2018 by Jeff Turner
7

I do these steps to solve this problem in Windows Server 2012, IIS 8.5. Should work for other versions too.

  1. Go to server manager, click add roles and features
  2. In the roles section choose: Web Server
  3. Under Security sub-section choose everything (I excluded digest, IP restrictions and URL authorization as we don't use them)
  4. Under Application Development choose .NET Extensibility 4.5, ASP.NET 4.5 and both ISAPI entries
  5. In the features section choose: NET 3.5, .NET 4.5, ASP.NET 4.5
  6. In the web server section choose: Web Server (all), Management Tools (IIS Management Console and Management Service), Windows
answered on Stack Overflow Apr 25, 2015 by Sanbuur Dahir Hersi • edited Apr 25, 2015 by shA.t
7

Try installing the 'Application Development' sub component of IIS as mentioned in this SO

  • Click "Start button" in the search box, enter "Turn windows features on or off"
  • in the features window, Click: "Internet Information Services"
  • Click: "World Wide Web Services"
  • Click: "Application Development Features"
  • Check (enable) the features. I checked all but CGI.

enter image description here

answered on Stack Overflow Aug 26, 2015 by IsaacBok • edited Apr 3, 2020 by w00ngy
7

Ehm. I had moved my site/files to a different folder. Without changing the path in the IIS website.

You may all laugh now.

answered on Stack Overflow Oct 5, 2015 by Frederik Struck-Schøning • edited Jun 10, 2016 by Frederik Struck-Schøning
7

Install ASP.NET Core module

Download the installer using the following link: https://www.microsoft.com/net/permalink/dotnetcore-current-windows-runtime-bundle-installer

answered on Stack Overflow Apr 22, 2019 by MrNams
6

One other possibility that fixed this problem for me:

IIS -> Edit Permissions -> Security Tab -> Give "Users" appropriate permissions (or IIS_IUSRS, depending on your setup)

answered on Stack Overflow Oct 23, 2012 by valen
6

To resolve this, make sure you installed the hosting bundle.

https://dotnet.microsoft.com/download/dotnet-core/3.1 enter image description here

answered on Stack Overflow Oct 22, 2020 by user3069438
4

This also happened to me when I had a default document of the same name (like index.aspx) specified in both my web.config file AND my IIS website. I ended up removing the entry from the IIS website and kept the web.config entry like below:

<system.webServer>
  <defaultDocument>
    <files>
      <add value="index.aspx" />
    </files>
  </defaultDocument>...
answered on Stack Overflow Sep 21, 2012 by theJerm
4

Sometimes this message has can be missing components in your IIS environment e.g. a particular framework, or an IIS feature like dynamic compression, rather than permissions to web.config.

If this is the case, a solution can be to install and use the Microsoft Platform Installer and install those missing components - you might have to take a stab at what exactly is missing because the error log and message don't tell you.

answered on Stack Overflow Dec 12, 2012 by eagle779
3

You need to set permission for your Website folder or copy they to wwwroot folder :) - If set permission, have 2 way: + Right click to Your Website folder + Or right click to Your Website in IIS => select Edit permission and Add a permission (IUSR - default iis user) Good luck ;-)

answered on Stack Overflow Jul 20, 2013 by SownRocker
3

In my case, it caused by application physical path point to a non-existent folder in IIS.

application setting screenshot

answered on Stack Overflow Jan 10, 2014 by chengbo
3

I had the issue as I copied my web.config file down from prod, changed everything not prod related except the Rewrite rules which were rewriting to httpS.

Removed those rules and ran fine.

answered on Stack Overflow Jul 8, 2016 by DanO
2

Pretty straight forward, IIS doesn't have access to your web.config. I'd start by taking the site out of your documents folder. Verify it has r/w permissions then as well.

answered on Stack Overflow Feb 9, 2012 by OnResolve
2

I too had the similar issue and i fixed it by commenting some sections in web.config file.

The project was earlier built and deployed in .Net 2.0. After migrating to .Net 3.5, it started throwing the exception.

Resolutions:

If your configuration file contains "<sectionGroup name="system.web.extensions>", comment it and run as this section is already available under Machine.config.

answered on Stack Overflow May 21, 2013 by Munna Singh
2

You can get this error if you have a synax error or issue in your web.config file.

For me, it was a stray ampersand in a URL that I was using in the AppSettings.

answered on Stack Overflow Sep 25, 2013 by Tim P. • edited May 23, 2017 by Community
2

On the IIS 7.5 error page you get click on 'View more Information' at the bottom of the page and in this case it will take you to the following Microsoft link:

http://support.microsoft.com/kb/942055

The 0x80070005 Error Code seems to be permissions related and following the steps in Resolution 2, Method 2 assigning the correct accounts with permissions on relevant folders should fix it - I spent 3 days looking for a solution until I came across it, worked straight after.

answered on Stack Overflow Dec 3, 2013 by kbbucks
2

got this problem with mapped drives, IIS doesn't work with mapped drives. Just use the unmapped drive.

answered on Stack Overflow May 6, 2014 by Rob Sedgwick
2

Explore the folder where your website is store and see you will get one extra folder "aspnet_client" delete that folder and it will work for you.

I tried this my problem is solved.

If it works for you please make it as answer so that some body else will also get solution.

answered on Stack Overflow Jul 14, 2014 by Rahul Sonone
2

Actually, any missing module can lead to this problem. In my case, it was CORS Module. So read the web.config and seek for any addon module that you specified in it and check that it is installed, or install it otherwise. Unfortunately, the error message does not help finding the problem at all.

answered on Stack Overflow Nov 15, 2020 by Ahmad
1

None of this worked for me, but I finally have a solution which worked for me:

remove this line in web.config:

<compilation debug="true" targetFramework="4.5"/>

don't remove this line

<compilation debug="true"/>
answered on Stack Overflow Aug 17, 2014 by Luca Steeb
1

Add local account IIS_IUSRS to security, and grand them read/execute access. that works on my case.

answered on Stack Overflow Nov 25, 2014 by user3534355
1

In my case it works just commenting (or deleting) the anonymousAuthentication property:

 <security>
     <authentication>
         <!--<anonymousAuthentication enabled="true" />-->
     </authentication>
 </security>
answered on Stack Overflow May 7, 2015 by Omar Vargas
1

In my case, configSections must be at top in configuration

<configuration>
<configSections>
...
</configSections>
<othersetting>
</othersetting>
.....
answered on Stack Overflow Sep 11, 2015 by Grey Wolf • edited Feb 16, 2016 by Grey Wolf
1

I got this bizarre error after specifying values in the web.config at the following-path system.webServer\security\authentication

We prefer to control how IIS is configured using web.config since IIS is a dreadful product and hard to configure using other methods.

The problem was that IIS stamps its authoritay by locking parts of configuration to outside meddlers.

The authentication configuration can be unlocked using the Feature Delegation applet at the IIS Server level, setting Read/Write.

Of course, whereas before we'd have to automate the configuration of IIS auth types, now we have to automate the unlocking. Did I mention IIS is a dreadful product?

answered on Stack Overflow Dec 21, 2015 by Luke Puplett
1

For me, I was getting latest from source control and this happened.

The applicationhost.config file's virtualDirectory path was different than in my machine.

I restored my own copy and it works. I am using IIS express.

enter image description here

answered on Stack Overflow Apr 1, 2016 by Harvey Darvey
1

I ended up solving this issue by deleting the obj folder of my web application. After rebuilding the solution, problem was gone.

answered on Stack Overflow Apr 15, 2017 by Farshid
0

In my case I selected application pool with .NET Framework 2.0 and enabled 32-bit application. I had .NET Framework 2.0 application.

I get a "An attempt was made to load a program with an incorrect format" error on a SQL Server replication project

answered on Stack Overflow Feb 7, 2014 by Neshta • edited May 23, 2017 by Community
0

Just change namespace from [WebService(Namespace = " http://tempuri.org/ ")] to

http://microsoft.com/webservices/

I solved my problem with this solution

answered on Stack Overflow Nov 28, 2014 by ComEngineer
0

After a server crash we had a site start giving the "HTTP 500.19 0x80070005 Error - Cannot read configuration file web.config" error. Normally it would be permissions or the anonymous user configuration, but those were set fine and hadn't changed. Suspecting something got corrupted in the IIS metabase (or in the in %windir%\system32\inetsrv\config\applicationHost.config since IIS7) I was able to get it back up and running by deleting the site in IIS and re-creating it.

answered on Stack Overflow Jun 25, 2015 by Snives
0

open your folder which content your project with Windows Explore. right click that folder and add rights for IUSER user.

answered on Stack Overflow Nov 12, 2015 by Unbreak My Heart
0

I changed my web.config file to provide actual path than a relative.

<httpPlatform processPath="F:\Projects\.....
instead of 
<httpPlatform processPath="..\approot\web.cmd"
answered on Stack Overflow Jan 16, 2016 by ANIL MANE
0

In my case what I did was just run visual studio in administrator mode.

answered on Stack Overflow Oct 26, 2016 by Daniel
0

Check the Error/HResult Code and follow this guide:

0x80070005

This problem occurs for one of the following reasons:

  • You are using IIS 7.0 on a computer that is running Windows Vista. Additionally, you configure the Web site to use UNC Passthrough authentication to access a remote Universal Naming Convention (UNC) share.

The IIS_IUSRS group does not have the appropriate permissions for the ApplicationHost.config file, for the Web.config file, or for the virtual/application directories of IIS.

Solution

Method 1

Do not configure the Web site to use UNC Passthrough authentication to access the remote UNC share. Instead, specify a user account that has the appropriate permissions to access the remote UNC share.

Method 2 (most likely)

Grant the Read permission to the IIS_IUSRS group for the ApplicationHost.config file or for the Web.config file.

So in simple words, you need to:

  1. Open Properties of the folder containing your reported Config File (such as Web.config).
  2. In Security tab, Edit... and Add...: IIS_IUSRS group and confirm.
answered on Stack Overflow Feb 12, 2018 by kenorb • edited Jun 20, 2020 by Community
0
0

I was getting this error when running my project from my local machine using visual studio 2017

Not one of these solutions worked for me. At the end of the day, the fix that worked for me was the following:

  1. Right click on the project -> Properties -> Web -> Project Url
  2. In the project Url text box, I incremented my port number by one and then clicked on Create Virtual Directory button.
  3. Save your changes and then run the project again.
answered on Stack Overflow Oct 31, 2018 by MartinS • edited Oct 31, 2018 by brasofilo
-2

* Very Easy Solution:

  1. Go to IIS

  2. Select your application from left Pane.

  3. Double click on Directory Browsing in middle Pane.

  4. Now go to right pane and under Action tab, Just click 'ENABLE'

That's all !!

People, try to understand the error: Config Error Cannot read configuration file due to insufficient permissions

answered on Stack Overflow Jul 7, 2014 by Aki

User contributions licensed under CC BY-SA 3.0