589

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?

Lex Li
  • 60,503
  • 9
  • 116
  • 147
Yasmeen
  • 10,991
  • 5
  • 16
  • 15
  • 4
    I had this issue after reverting some changes via Subversion (although it could be a coincidence). I noticed that the `Web.config` file's ACLs were different to other files in the directory *and it was not inheriting from it's parent*. I enabled ACL inheritance and everything went back to normal. – ta.speot.is Nov 07 '12 at 00:01
  • 2
    My solution was slightly different. On some Windows Server 2008 machines, you need to give access to the "IIS_IUSRS" group, not the "IUSR" user--within the site folder security permissions. Make sure to go to your machine's location. – JustBeingHelpful Mar 13 '13 at 02:18
  • [See this](http://www.aspdotnet-suresh.com/2011/05/requested-page-cannot-be-accessed.html) too it might be one of the reason – RajeshKdev Aug 07 '13 at 06:54
  • 18
    I had this issue moving a site to a server that didn't have the IIS Url Rewrite module installed. – ScottE Jan 01 '15 at 20:27
  • possible duplicate of [ASP.NET: HTTP Error 500.19 – Internal Server Error 0x8007000d](http://stackoverflow.com/questions/16836473/asp-net-http-error-500-19-internal-server-error-0x8007000d) – Tomas Kubes Feb 11 '15 at 16:05
  • 1
    This can happen IF you've renamed your server. I did this to myself - and ultimately had to just go in (Windows Server 2012 R2) and re-add IIS APPPOOL\SiteName... and that 100% fixed this. – Michael K. Campbell Aug 19 '15 at 04:11
  • 5
    if you're new to deploying ASP.NET Core apps on your older 2008 R2 server, you need to [Install the .NET Core Windows Server Hosting bundle](https://learn.microsoft.com/en-us/aspnet/core/publishing/iis) - as I learned [at this answer](http://stackoverflow.com/a/43239181/1520850) – bkwdesign May 10 '17 at 18:28
  • First make sure you download and install "DotNetCore.2.0.0-WindowsHosting.exe". As of today, it is here. https://download.microsoft.com/download/B/1/D/B1D7D5BF-3920-47AA-94BD-7A6E48822F18/DotNetCore.2.0.0-WindowsHosting.exe Restart IIS. – RasikaSam Oct 31 '17 at 23:57
  • 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:47
  • I encountered this issue when deploying a non-ASP.NET Core hosted (stand alone) Blazor Web Assembly (PWA) app to an IIS subsite. The fix was to change the base href in my index.html to the name of my subsite/application. So I changed to . DeploymentTest is the name of my subsite in IIS and application. Links that helped: https://developercommunity.visualstudio.com/t/blazor-webassembly-deploy/1103783. https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/?view=aspnetcore-6.0&tabs=visual-studio#app-base-path. – Tyler Franklin Sep 29 '22 at 14:42

52 Answers52

794

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

bkaid
  • 51,465
  • 22
  • 112
  • 128
  • This was it for me.. removed the rewrite section (which is wasn't really needing anyhow) and all is good. – Andrew Patterson Feb 14 '13 at 01:41
  • 161
    Well played. It'd be nice if IIS would throw an "I don't understand what is" error, rather than complaining about malformed XML. – Evan Haas Jun 11 '13 at 14:22
  • How can you tell that the site is configured to use the rewrite module? – Jon Crowell Sep 19 '13 at 13:36
  • 8
    Thank you much - that was my issue too. Rewrite module is in use if you see tag. One would think IIS could tell you what is can't parse. – scolestock Nov 06 '13 at 21:58
  • How is someone supposed to guess if the error doesn't mention it? Thanks man! – Fabio Milheiro Aug 04 '14 at 09:32
  • 6
    Nice easy way to resolve the missing dependancy on the command line; webpicmd /Install /Products:UrlRewrite2 – cirrus Oct 20 '14 at 13:00
  • I attempted just about every other solution I could before trying this one (wanted to avoid installing something on my server, if possible). Eventually, I gave this a try, and it worked. Cheers! – Nick May 10 '16 at 14:41
  • 2
    I'd just like to note that if your web.config includes a tag, then you need the rewrite module. – Jono Jul 07 '16 at 11:31
  • @Jono - not me. I had the problem with IIS on my dev machine - don't want to rewrite on my dev machine. But on live, yes I agree. – Resource Jun 29 '17 at 17:06
  • For the dozens of times I've seen this error, it is usually the missing IIS URL Rewrite Module. – Crispy Ninja Jun 23 '19 at 18:57
  • 1
    Had the same problem running an Angular 8 application in IIS 10 on Windows 10. The solution was to load Microsoft URL Rewriting from: https://www.iis.net/downloads/microsoft/url-rewrite. The test to determine that this was the issue was to edit my web.config file to comment out the section. With the section commented out, the app worked but could only browse to the root component. As soon as did this install, the app including routes worked. – Chuck Bevitt Oct 20 '19 at 19:38
  • Exactly 8 years later and this is still relevant :) Thank you! – Jan W Jan 21 '21 at 00:12
  • Проклятый UrlRewrite! – mrhotroad Mar 17 '23 at 11:02
498

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.

Martin Braun
  • 10,906
  • 9
  • 64
  • 105
Yasmeen
  • 10,991
  • 5
  • 16
  • 15
  • Someone must have removed this role service from a server that had been running for months. I would never have guessed to double check that. Ugh. – SixOThree Aug 12 '13 at 16:59
  • 2
    Even easier, using the command line: `dism /NoRestart /Online /Enable-Feature /FeatureName:IIS-ASPNET` – i3arnon Jul 22 '14 at 14:26
  • 5
    Thanks... how can they release a product with such low level of error messages? – Vland Jul 21 '16 at 14:51
  • My section had a reference to WebDAV and once I added the WebDAV feature to IIS it worked. – Andy Roberts Apr 12 '18 at 15:48
  • After Windows 10 update including updates to .Net 3.5 and 4.8, I encountered this problem. The above solution worked for me and was a lifesaver. – noCodeMonkeys Aug 08 '20 at 19:48
  • Worked for me too, I was pretty sure I checked the ASP.NET 4.6 checkbox when I installed IIS, but when I checked, it wasn't selected. – Neill Dec 03 '20 at 05:36
200

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.

Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438
intermension
  • 2,593
  • 2
  • 18
  • 14
  • 4
    Can I give this permission programmatically? Please help. I am having same problem. – pcbabu May 22 '13 at 12:47
  • 1
    Thanks this solved my problem as well. I am using impersonation which apparently makes it necessary to assign READ permissions to the application's directory for the impersonated account. – Cesar Jun 30 '13 at 04:34
  • 2
    I keep getting "Failed to enumerate objects in the container. Access is denied." afterI I give permission – RollRoll Mar 12 '15 at 23:40
  • 9
    Right click on folder you need to give security permission to. This is the root folder where you application is published and is the same folder as your IIS website physical path. Choose properties from the context menu and click on the Security tab. Edit users, and then Add a user. Click the Locations button and choose the top icon (looks like My Computer). In the text area, enter IIS_IUSRS. Press OKs repeatedly until all context menus are close. Restart your web site and navigate to it again. – Jeremy Ray Brown Nov 17 '16 at 22:27
  • If you don't want to figure out permissions on the physical path for the website, then give permission to everyone! That is a quick and not-recommended hack for all physical file/folder access. – Jeremy Ray Brown Nov 17 '16 at 22:33
  • @ThePoet i'm getting the same message as you - "Failed to enumerate objects in the container." Did you find a resolution for this? – Manachi May 23 '17 at 03:03
  • @Manachi I fix it after realizing I didn't have .net framework 4 installed on my server and then I had the application pool running on framework 4. – RollRoll May 23 '17 at 15:13
62

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'
John
  • 29,788
  • 18
  • 89
  • 130
Sukhdevsinh Zala
  • 1,126
  • 2
  • 14
  • 19
  • 3
    I wouldn't recommend this for production purposes. I believe IIS_IUSRS is an anonymous account and you'd be giving it full access to the entire directory structure of the website – Jacques Jul 23 '18 at 09:15
  • Saved my day too, as I figured out permission is the culprit too I used another apppool identity and it worked! – Near Jul 05 '19 at 05:02
44

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

Michael
  • 2,268
  • 20
  • 24
  • 4
    You can also do this exact same thing in project => properties => project url => create virtual directory, choose yes to remap to the correct physical path when prompted – Adam Diament Nov 01 '16 at 11:48
  • In my case it was bit different but it gave my direction, Thank you very much, it helped me lot :) – Bharat Feb 02 '17 at 09:22
  • I was running my project on the D: drive and changed it to E: drive after reading this answer then I realized the physical path had changed. Thanks – Chris Claude May 28 '22 at 18:17
40

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

JS_Diver
  • 756
  • 7
  • 19
  • Simply installing the .NET Core SDK *is not enough* to run your ASP.NET Core websites under IIS. I spent several hours working through this error... – Ryan Rodemoyer Apr 15 '19 at 14:27
  • 1
    It may not be enough, but it does resolve this error. Worked for me. I had assumed that all the .NET components were already included. – pcalkins Jun 07 '19 at 18:47
  • Yeah, had to install "Runtime & Hosting Bundle" here: https://dotnet.microsoft.com/download/dotnet-core/2.2 – Kirk Woll Jun 25 '19 at 12:34
  • Ok, "self-contained" package does not live up to its title. – SLCH000 Aug 01 '19 at 11:06
40

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

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

user3069438
  • 421
  • 4
  • 2
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.

Jon Crowell
  • 21,695
  • 14
  • 89
  • 110
  • As a variant of this, it turns out that I set the path incorrectly to the site itself. I accidentally went through the mapped network share instead of the local system file path. – David Jul 30 '14 at 00:54
  • 2
    Had the same face-palm moment. I moved my website to a sub-folder, and thought I'd correctly typed the new path into IIS. The site still appeared to have all the required folders etc underneath it showing in the tree in IIS, so it didn't trigger this as being the reason. I reset permissions etc, didn't resolve it. Then talking through the issue it was suggested to me in passing...and I now have a working site again after 1 hour of wasted time! – ladygargar Feb 27 '16 at 22:48
  • Where is this path set? This seems to be my problem but I can't find what I need to change – Drew Rochon May 03 '16 at 14:23
  • In development environment: .vs > config > applicationhost.config This is what happens when you don't have a GIT ignore on the file and developers start checking it in. – Savage Jun 24 '16 at 14:44
  • I had an extra "\" slash in my physical path - shesh. Thanks for this – J King Sep 30 '16 at 15:40
  • Was working for a year .. until I had to move the directory down one extra level for GIT restructuring a few months back for a different solution. – Esaith Sep 29 '20 at 18:03
20

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".

yoel halb
  • 12,188
  • 3
  • 57
  • 52
  • From following website: https://www.iis.net/learn/get-started/planning-for-security/understanding-built-in-user-and-group-accounts-in-iis The IIS_IUSRS group replaces the IIS_WPG group. This built-in group has access to all the necessary file and system resources so that an account, when added to this group, can seamlessly act as an application pool identity. – Jeremy Ray Brown Nov 17 '16 at 22:37
  • Still getting access denied. – GreySage May 25 '18 at 22:06
14

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

Tanuj Gulati
  • 179
  • 2
  • 5
13

Install ASP.NET Core module

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

MrNams
  • 638
  • 8
  • 14
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

Celt
  • 2,469
  • 2
  • 26
  • 43
  • To fix my vs 2017 development environment I had to remove IIS from my windows 7 features. Add it back, update and install all the stuff as needed. The final step was running the regiis from with visual studio 2017 command prompt. Now it all works again, 8 hours of time spent fixing this. uck.. – Warren LaFrance May 15 '18 at 14:42
9

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

You may all laugh now.

Frederik Struck-Schøning
  • 12,981
  • 8
  • 59
  • 68
8

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
shA.t
  • 16,580
  • 5
  • 54
  • 111
8

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

w00ngy
  • 1,646
  • 21
  • 25
IsaacBok
  • 424
  • 5
  • 18
8

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.

Jeff Turner
  • 1,318
  • 8
  • 12
  • How can i do this?? "make sure your aspnet or IUSR users have read access to the application's directory" – Yasmeen Feb 09 '12 at 18:03
  • 6
    go to C:\Users\Yasso\Documents\Visual Studio 2008\WebSites\WebSite5\ and make sure the WebSite5 directory has read permissions for the IUSR and IIS_IUSRS group. You do this by right clicking on the directory and selecting properties, then going to the security tab. – Jeff Turner Feb 09 '12 at 18:06
  • But i don't see IUSR and IIS_IUSRS group in the group or user name!! i don't know what is the problem?? – Yasmeen Feb 09 '12 at 18:08
  • 1
    do you see an option for network service? by default that is what the application pool will use when you're working on your desktop (if i recall correctly) – Jeff Turner Feb 09 '12 at 18:12
  • Option for network service in the properties or where?? Sorry Jeff i can't understand what you say?? – Yasmeen Feb 09 '12 at 18:17
  • 1
    when you go to the security tab, after you've right-clicked on the folder and selected properties. Click the "Add" button, which should spawn another window with an "Edit" button. Click the "Edit" button and type in "Network Service" into the textbox, It should find the user and add it to the list. Then make sure that user has Read priviledges at the very least. – Jeff Turner Feb 09 '12 at 18:19
  • No there is no "Network Service" in the select user or group windows!! – Yasmeen Feb 09 '12 at 18:24
  • suggest @JeffTurner ammend his answer to include IIS_IUSRS – Aaron Hudon Mar 06 '18 at 05:15
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)

valen
  • 807
  • 1
  • 16
  • 43
5

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>...
theJerm
  • 4,482
  • 2
  • 30
  • 23
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.

eagle779
  • 694
  • 6
  • 17
  • NB: dynamic compression is in the 'windows features' list and not MPI – Simon_Weaver Mar 29 '13 at 22:08
  • @Simon_Weaver actually dynamic compression _is_ in the list of things MPI will install for you and has been since 2012, perhaps even before then. cheers. – eagle779 Apr 09 '14 at 01:24
4

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.

Ahmad
  • 5,551
  • 8
  • 41
  • 57
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 ;-)

SownRocker
  • 51
  • 1
3

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.

Community
  • 1
  • 1
Tim P.
  • 2,903
  • 24
  • 26
  • 1
    I also got this with a Password in a Connection String that had an **&** - encoding it to & got me past this problem. Thanks, this is the only answer here not to do with Permissions. – Jeremy Thompson Sep 13 '18 at 03:36
3

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

application setting screenshot

chengbo
  • 5,789
  • 4
  • 27
  • 41
3

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

Rob Sedgwick
  • 4,342
  • 6
  • 50
  • 87
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.

DanO
  • 407
  • 5
  • 15
3

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.

OnResolve
  • 4,016
  • 3
  • 28
  • 50
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.

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.

kbbucks
  • 108
  • 8
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.

Rahul Sonone
  • 2,685
  • 1
  • 27
  • 38
2

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

Tracy Zhou
  • 714
  • 1
  • 7
  • 11
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"/>
Luca Steeb
  • 1,795
  • 4
  • 23
  • 44
1

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

1

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

 <security>
     <authentication>
         <!--<anonymousAuthentication enabled="true" />-->
     </authentication>
 </security>
1

In my case, configSections must be at top in configuration

<configuration>
<configSections>
...
</configSections>
<othersetting>
</othersetting>
.....
Wolf
  • 6,361
  • 2
  • 28
  • 25
1

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

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?

Luke Puplett
  • 42,091
  • 47
  • 181
  • 266
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

Harvey Darvey
  • 706
  • 8
  • 16
1

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

Farshid
  • 5,134
  • 9
  • 59
  • 87
1

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.
Community
  • 1
  • 1
kenorb
  • 155,785
  • 88
  • 678
  • 743
1

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

Dale K
  • 25,246
  • 15
  • 42
  • 71
Maruf
  • 354
  • 3
  • 8
1

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.

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

Community
  • 1
  • 1
Neshta
  • 2,605
  • 2
  • 27
  • 45
0

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

http://microsoft.com/webservices/

I solved my problem with this solution

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.

Snives
  • 1,226
  • 11
  • 21
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"
ANIL MANE
  • 1,395
  • 2
  • 16
  • 30
0

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

Daniel
  • 3,322
  • 5
  • 30
  • 40
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.
brasofilo
  • 25,496
  • 15
  • 91
  • 179
MartinS
  • 105
  • 3
  • 11
0

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

behza_d
  • 15
  • 3
0

It was simple for me i add the missing features

enter image description here

Aylian Craspa
  • 422
  • 5
  • 11
0
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
-3

* 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

Aki
  • 149
  • 4
  • 13