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

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

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

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

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

有什么问题吗?


当前回答

就我而言,问题在于我在吸毒

<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="true" stdoutLogFile="C:\Data\logs\stdout">
      <environmentVariables>
        <environmentVariable name="VAL" value="SOME VALUE" />
      </environmentVariables>
    </aspNetCore>

但我使用的是。net 4.6.1,在这个版本中,aspnetcore部分似乎不存在于web.config中。把它去掉就解决了问题。

其他回答

我做这些步骤来解决这个问题 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

安装ASP。NET核心模块

使用以下链接下载安装程序: https://www.microsoft.com/net/permalink/dotnetcore-current-windows-runtime-bundle-installer

确保在启用IIS后安装了适当的托管包

如果在启用IIS之前已经安装了托管包,重新安装托管包将解决问题

在我的例子中:

已安装的主机包 启用IIS

然后收到了这个不愉快的消息:

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

重新安装托管包解决了这个问题

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

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

我有问题,因为我复制我的网络。从prod删除配置文件,更改了所有与prod无关的内容,除了重写规则,重写为httpS。

删除了这些规则,运行正常。