我想在IIS上用IIS管理器上传我自己的asp.net网站。但是当我这样做时,我得到以下错误

HTTP错误500.19 -内部服务器错误不能被请求的页面 访问,因为该页的相关配置数据为 无效的

模块IIS Web核心 通知未知 处理人尚未确定 错误码0x80070005 Config Error由于权限不足,无法读取配置文件 配置文件\\?\C:\用户\亚索\文档\Visual Studio 2008\网站\WebSite5\web.config

我搜索了很多次这个错误的解决方案,但没有一个解决方案解决了这个错误。

我的IUSR账户有问题。我在web.config的属性中的“组或用户名”中看不到这个帐户。

有什么问题吗?


当前回答

对于Visual Studio (VS)开发人员: 正如Harvey Darvey, Savage和Snives所暗示的,您的应用程序主机配置可能指向错误的应用程序物理路径。在/.vs/config/applicationhost目录下搜索virtualDirectory。如果不正确,请使用config命令修改物理路径。

确保physicalPath正确:

其他回答

我最终通过删除我的web应用程序的obj文件夹解决了这个问题。重新构建解决方案后,问题就消失了。

在我的情况下,configSections必须在配置的顶部

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

在服务器崩溃后,我们有一个网站开始给出“HTTP 500.19 0x80070005错误-无法读取配置文件web。配置”的错误。通常是权限或匿名用户配置,但这些都设置得很好,没有更改。怀疑IIS元数据库中的某些内容已损坏(或在%windir%\system32\inetsrv\config\applicationHost中)。我可以通过在IIS中删除站点并重新创建站点来让它恢复并运行。

在我的情况下,它只是注释(或删除)anonymousAuthentication属性:

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

我做这些步骤来解决这个问题 Windows Server 2012, IIS 8.5。应该也适用于其他版本。

Go to server manager, click add roles and features In the roles section choose: Web Server Under Security sub-section choose everything (I excluded digest, IP restrictions and URL authorization as we don't use them) Under Application Development choose .NET Extensibility 4.5, ASP.NET 4.5 and both ISAPI entries In the features section choose: NET 3.5, .NET 4.5, ASP.NET 4.5 In the web server section choose: Web Server (all), Management Tools (IIS Management Console and Management Service), Windows