无法访问请求的页面,因为页面的相关配置数据无效错误

在尝试在IIS上部署ASP.NET网站时遇到了'页面的相关配置数据无效'错误,表现为HTTP 500.19内部服务器错误。问题可能涉及配置文件损坏、权限不足或缺少IIS组件。解决方案包括检查配置文件权限、为IIS_IUSRS或特定应用池分配权限,以及确保所有必需的IIS组件和框架已安装。
摘要由CSDN通过智能技术生成

本文翻译自: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 the IIS through IIS manager . 我想通过IIS manager在IIS上传我自己的asp.net网站。 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 HTTP错误500.19 - 内部服务器错误无法访问请求的页面,因为页面的相关配置数据无效

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 in IUSR account. 我在IUSR帐户中遇到问题。 I can't see this account in the "group or user names" in the properties of the web.config . 我无法在web.config的属性中的“组或用户名”中看到此帐户。

What is the problem? 问题是什么?


#1楼

参考:https://stackoom.com/question/cfXi/无法访问请求的页面-因为页面的相关配置数据无效错误


#2楼

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. 它无法读取配置文件的原因是因为运行Web应用程序的进程无权访问文件/目录。 So you need to give the process running your web app those permissions. 因此,您需要为运行Web应用程序的进程提供这些权限。

The access rights should be fairly straightforward, ie at least Read , and, depending on your app, maybe Write . 访问权限应该相当简单,即至少读取 ,并且,根据您的应用程序,可能是写入

Above, you mention IUSR etc. not being in the properties for web.config . 上面,你提到IUSR等不在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. 如果你的意思是IUSR没有列在文件的安全选项卡中那么这是一件好事。 One doesn't want to give IUSR any kind of permission to web.config . 一个人不想给IUSR任何web.config的权限。 The role IUSR is an anonymous internet user. 角色IUSR是一个匿名的互联网用户。

The file web.config should only be accessible through your application. 只能通过您的应用程序访问文件web.config

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. 问题是你没有说你正在使用哪个操作系统和IIS版本,因此很难建议采取哪些步骤。

Ie in IIS 7.5, the error message you're quoting is likely to occur due to your ApplicationPoolIdentity not being assigned the permissions. 即在IIS 7.5中,由于您没有为ApplicationPoolIdentity分配权限,可能会出现您引用的错误消息。 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. 您的Web应用程序属于应用程序池,因此您需要授予Web应用程序的应用程序池运行的OS帐户的权限。 Often this is something like NetworkService but you may have customized it to run under a purpose made account. 通常这类似于NetworkService,但您可能已将其定制为在专用帐户下运行。 Without more info it's difficult to help you. 没有更多信息,很难帮助你。


#3楼

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). 您需要在本地计算机上为IIS_IUSRS分配权限(但您不必为IUSR分配,实际上即使您明确拒绝权限它也能正常工作)。

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. 要分配权限,只需右键单击文件夹,然后在安全选项卡上确保授予正确的权限,如果未列出用户,则单击“添加”,然后输入IIS_IUSRS(并确保在“域”下的本地选择计算机,或输入名称字段YourLocalComputerName \\ IIS_IUSRS),然后你就可以了。

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 ". 如果您希望可以而不是为IIS_IUSRS组分配权限,则可以改为分配给应用程序池,该应用程序池通常应为“IIS APPPOOL \\ app pool name ”。


#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. 当我在web.config文件和我的IIS网站中都指定了一个同名的默认文档(如index.aspx)时,这也发生在我身上。 I ended up removing the entry from the IIS website and kept the web.config entry like below: 我最终从IIS网站删除了该条目并保留了web.config条目,如下所示:

<system.webServer>
  <defaultDocument>
    <files>
      <add value="index.aspx" />
    </files>
  </defaultDocument>...

#5楼

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) IIS - >编辑权限 - >安全选项卡 - >为“用户”提供适当的权限(或IIS_IUSRS,具体取决于您的设置)


#6楼

Sometimes this message has can be missing components in your IIS environment eg a particular framework, or an IIS feature like dynamic compression, rather than permissions to web.config. 有时,此消息可能缺少IIS环境中的组件,例如特定框架或动态压缩等IIS功能,而不是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. 如果是这种情况,解决方案可以是安装和使用Microsoft平台安装程序并安装那些缺少的组件 - 您可能不得不采取措施,因为错误日志和消息没有告诉您。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值