Reputation: 11331
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 Code0x80070005
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
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
Reputation: 365
Please Install Url rewriter Here is Link https://www.iis.net/downloads/microsoft/url-rewrite it will Work
Upvotes: 0
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
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
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:
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
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
Reputation: 734
In addition to
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
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
Reputation: 681
To resolve this, make sure you installed the hosting bundle.
https://dotnet.microsoft.com/download/dotnet-core/3.1
Upvotes: 65
Reputation: 434
Try installing the 'Application Development' sub component of IIS as mentioned in this SO
Upvotes: 9
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
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
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:
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
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:
Upvotes: 0
Reputation: 168
Install the .NET Core Windows Server Hosting bundle
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.1
Upvotes: 0
Reputation: 1215
I was having the same problem, here is the solution that worked for me.
Upvotes: 70
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
Reputation: 166399
Check the Error/HResult Code and follow this guide:
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.
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.
Grant the Read permission to the
IIS_IUSRS
group for theApplicationHost.config
file or for theWeb.config
file.
So in simple words, you need to:
Web.config
).IIS_IUSRS
group and confirm.Upvotes: 1
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
Reputation: 3374
In my case what I did was just run visual studio in administrator mode.
Upvotes: 0
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.
Make sure the physicalPath is correct:
Upvotes: 46
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
Reputation: 13221
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
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.
Upvotes: 1
Reputation: 6499
In my case, configSections must be at top in configuration
<configuration>
<configSections>
...
</configSections>
<othersetting>
</othersetting>
.....
Upvotes: 1
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
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
Reputation: 11
open your folder which content your project with Windows Explore. right click that folder and add rights for IUSER user.
Upvotes: 1
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