C# 500.19 - 内部服务器错误 - 由于页面的相关配置数据无效,无法访问请求的页面

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18620654/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-10 12:46:30  来源:igfitidea点击:

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

c#asp.net-mvc-3iis-7

提问by scapegoat17

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:

我正在尝试在我的 IIS 中运行一个 MVC Web 应用程序。不幸的是,我完全陷入了这个错误:

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.

我不太确定还能做什么。我也尝试过授予 web.config 文件的读取权限,但这似乎不起作用。

If anyone has any information or would be able to help me work through this it would be much appreciated. Thanks!

如果有人有任何信息或能够帮助我解决这个问题,我们将不胜感激。谢谢!

采纳答案by rene

On this msdn blog: Troubleshooting HTTP 500.19 Errors in IIS 7in sceanrio 8 for error code 0x80070005 (E_ACCESSDENIED - General access denied error) it says:

在此msdn 博客上:对错误代码 0x80070005 (E_ACCESSDENIED - 一般访问被拒绝错误)中的 IIS 7中的HTTP 500.19 错误进行故障排除,它说:

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.

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.

回答by Serj Sagan

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\wwwrootusing 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

我的问题是我不小心安装了另一个站点作为默认站点而不是 IIS 默认站点(通过打开另一个项目。)我不得不删除默认站点并C:\inetpub\wwwroot使用我的域登录将其重新指向默认位置作为用户绕过然后刚刚重新打开了我试图运行的项目(显示此错误的项目),这一切都是愚蠢的

回答by user2173353

I fixed this by restarting VS.

我通过重新启动 VS 解决了这个问题。

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

我在另一个 VS 实例中打开了一个配置文件,显然某事发疯了......

回答by Josh D

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.

就我而言,我需要安装 IIS URL 重写模块 2.0,因为它正在 web.config 中使用,这是第一次在新机器上运行站点。

回答by Thomas

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

我有一个名为 web.config 的子文件夹重命名这个文件夹解决了这个问题

回答by nemesisfixx

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_IUSRSare given, still I could solve this.

我正在从虚拟机内部访问项目 - 从主机操作系统(Windows 10)共享项目文件夹。在尝试了许多解决方案之后,甚至确保IIS_IUSRS给定了权限,我仍然可以解决这个问题。

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_IUSRSgroup full control over this new dir as well... maybe that's not really necessary in this case? I'm lazy to test that ATM.

最终,我将此文件夹从主机复制到来宾操作系统上的路径上,现在我可以毫不费力地正确运行相同的 ASP.NET 项目。但是,我也继续让IIS_IUSRS小组完全控制这个新目录......也许在这种情况下这不是真的必要?我懒得去测试那个 ATM。

回答by Amit Yadav

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
  1. 进入控制面板
  2. 转到程序和功能
  3. 打开或关闭窗口功能
  4. 进入互联网信息服务节点
  5. 关注万维网服务
  6. 然后请检查应用程序开发功能
  7. 然后请检查所有节点,特别是 Asp 或应用程序框架,如 Asp.net 3.5 或 ASP.NET 4.5,无论你有什么

回答by Aravind Rengasamy

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

**启用** **应用程序开发功能**下的所有功能并刷新**IIS**

Goto Windows Features on or Off . EnableAll Features under Application Development Featuresand Refresh the IIS. Its Working

打开或关闭转到 Windows 功能。启用应用程序开发功能下的所有功能并刷新IIS它的工作

回答by shruti Thakker

If Folder getting from other, and host file is already generated on ProjectName\.vs\configfolder, then it conflicts with a new one and gets this error.
So delete host file from ProjectName\.vs\configand restart project once again. It was worked for me

如果文件夹来自其他文件夹,并且文件ProjectName\.vs\config夹上已经生成了主机文件,则它与新文件夹冲突并出现此错误。
因此,从中删除主机文件ProjectName\.vs\config并再次重新启动项目。它对我有用

回答by PMC Karur

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

就我而言,服务器的版本框架低于您的应用程序。安装了最新版本的框架并解决了这个问题。