Yasmeen
Yasmeen

Reputation: 11331

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

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?

Upvotes: 614

Views: 1182072

Answers (30)

Amer Jamaeen
Amer Jamaeen

Reputation: 766

Make sure the following modules are registered in IIS modules: AspNetCoreModule & AspNetCoreModuleV2

you can install them by running the following commands:

open cmd as admin

navigate to inetSrv location C:\Windows\System32\inetsrv run: appcmd.exe

install module /name:AspNetCoreModule /image:%windir%\system32\inetsrv\aspnetcore.dll

install module /name:AspNetCoreModuleV2 /image:"%ProgramFiles%\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll"

Upvotes: 0

Asim Khan
Asim Khan

Reputation: 365

Please Install Url rewriter Here is Link https://www.iis.net/downloads/microsoft/url-rewrite it will Work

Upvotes: 0

Shakti Srivastav
Shakti Srivastav

Reputation: 300

You need to ensure you have installed Microsoft Visual C++ 2015 
Redistributable:-(link)
https://www.microsoft.com/en-us/download/confirmation.aspx? 
id=48145
in your system 
then follow these steps
You have to install these software
1 httpPlatformHandler_amd64
2 dotnet-sdk-6.0.408-win-x64 or dotnet-hosting-7.0.5-win-x64
3 runtime-aspnetcore-6.0.16-win-x64 or aspnetcore-runtime-7.0.5- 
  win-x64
from these websites
1 - https://www.iis.net/downloads/microsoft/httpplatformhandler
2 - https://dotnet.microsoft.com/en-us/download/dotnet/6.0
Or  https://dotnet.microsoft.com/en-us/download/dotnet/7.0
3 - https://dotnet.microsoft.com/en-us/download/dotnet/thank- 
    you/runtime-aspnetcore-6.0.16-windows-x64-installer
Or  https://dotnet.microsoft.com/en-us/download/dotnet/thank- 
    you/runtime-aspnetcore-7.0.5-windows-x64-installer
Then make changes in windows features on/off
Open control panel
Click on Program
Click on Turn windows features on/off
Locate “Internet Information services IIS” in the pop up window and 
expand its node
Expand the “World Wide Web Service” node
Expand “Application Development Features” node
Check the check box of “ASP.NET”
Then click ok button wait to install feature and restart IIS

Upvotes: 0

Aylian Craspa
Aylian Craspa

Reputation: 466

It was simple for me i add the missing features

enter image description here

Upvotes: 0

behza_d
behza_d

Reputation: 25

firstly be sure the credentials are ok be careful that you are using the version of a windows which is not on server mode totally, so there are some limits any way try these: 1-add the physical directory root of your project to the directory which the default website on the IIS is located there and is working. By this action you make sure that the same permission is fetching your project directory too. 2- try to install the dotnet-hosting-7.0.3-win and enable the needed features from system features for IIS. 3- try to restart the OS after each installation. in order to find the correct directory of the default IIS website on IIS which is working try to check IIS is working or not by browsing localhost only in a browser in the system them try to see the IIS manager by typing inetmgr in run and go among the IIS manager then on the connections(left sidebar) you can find the default website and its directory. mainly by default its C:\inetpub

Upvotes: 0

Maruf
Maruf

Reputation: 456

Make sure to install the appropriate Hosting Bundle after enabling IIS

If you have already installed Hosting Bundle before enabling IIS reinstalling Hosting Bundle solves the problem

In my case:

  1. Installed Hosting Bundle
  2. Enabled IIS

and got this unhappy message:

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

Reinstalling Hosting Bundle solved the problem

Upvotes: 3

Eduard Frankford
Eduard Frankford

Reputation: 351

In my case the problem was that I was using

<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="true" stdoutLogFile="C:\Data\logs\stdout">
      <environmentVariables>
        <environmentVariable name="VAL" value="SOME VALUE" />
      </environmentVariables>
    </aspNetCore>

But I was using .net 4.6.1 and it seems with this version the section aspnetcore does not exist in the web.config. Removing it solved the problem.

Upvotes: 2

Tracy Zhou
Tracy Zhou

Reputation: 734

In addition to

  • make sure the publish destination folder has the correct security settings for IUSR and IIS_IUSRS
  • control panel → Programs → Turn windows features on or off → Internet Information Services → World Wide Web Services → Application development features → turn on .net features

If you are still getting errors, try to check your web.config file. I had no problems deploying my web app to the cloud, but somehow my local IIS was throwing some errors. I fixed the error by removing some commented code from web.config

Upvotes: 2

Ahmad
Ahmad

Reputation: 5760

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.

Upvotes: 5

user3069438
user3069438

Reputation: 681

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

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

Upvotes: 65

IsaacBok
IsaacBok

Reputation: 434

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

Upvotes: 9

MrNams
MrNams

Reputation: 645

Install ASP.NET Core module

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

Upvotes: 17

JS_Diver
JS_Diver

Reputation: 786

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://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.2

Upvotes: 43

Yasmeen
Yasmeen

Reputation: 11331

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.

Upvotes: 507

MartinS
MartinS

Reputation: 105

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.

Upvotes: 0

Sukhdevsinh Zala
Sukhdevsinh Zala

Reputation: 1215

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'

Upvotes: 70

Jeff Turner
Jeff Turner

Reputation: 1347

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.

Upvotes: 10

kenorb
kenorb

Reputation: 166399

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.

Upvotes: 1

Farshid
Farshid

Reputation: 5354

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

Upvotes: 1

Daniel
Daniel

Reputation: 3374

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

Upvotes: 0

Michael
Michael

Reputation: 2414

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

Upvotes: 46

DanO
DanO

Reputation: 417

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.

Upvotes: 4

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

You may all laugh now.

Upvotes: 10

Harvey Darvey
Harvey Darvey

Reputation: 714

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

Upvotes: 1

Wolf
Wolf

Reputation: 6499

In my case, configSections must be at top in configuration

<configuration>
<configSections>
...
</configSections>
<othersetting>
</othersetting>
.....

Upvotes: 1

ANIL MANE
ANIL MANE

Reputation: 1405

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

<httpPlatform processPath="F:\Projects\.....
instead of 
<httpPlatform processPath="..\approot\web.cmd"

Upvotes: 0

Luke Puplett
Luke Puplett

Reputation: 45115

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?

Upvotes: 1

Unbreak My Heart
Unbreak My Heart

Reputation: 11

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

Upvotes: 1

Snives
Snives

Reputation: 1254

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.

Upvotes: 0

Related Questions