【问题标题】:Could not retrieve the logging settings - IIS web.config .Net Core 1.1无法检索日志记录设置 - IIS web.config .Net Core 1.1
【发布时间】:2017-05-12 02:37:42
【问题描述】:

当我尝试浏览到我的 IIS 站点时,当前出现内部服务器错误,但没有有用的错误消息。我注意到的一件事是,当我访问 IIS 模块时出现上述错误或类似错误。我的 web.config 非常基本,如下所示:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="dotnet" arguments=".\MyWebsite.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
  </system.webServer>
</configuration>

当我注释掉时:

<aspNetCore processPath="dotnet" arguments=".\MyWebsite.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />

我的 IIS 模块已加载,但我仍然收到内部服务器错误。

最初,我认为这可能是我安装 .Net Core 1.1 运行时的错误,但是当我从命令行运行命令 dotnet MyWebsite.dll 时,我的网站运行良好。

任何想法/帮助表示赞赏,谢谢!

【问题讨论】:

    标签: .net iis web-config .net-core


    【解决方案1】:

    问题是我下载了 .Net Core Runtime Windows (x64) 安装程序,但应该下载了 .Net Core Runtime Windows Server Hosting(x64 和 x86)安装程序。 Windows Server Hosting 包括 ASPNetCoreModule。

    我通过查看站点下 IIS 中的处理程序映射来确定问题(在注释掉导致 IIS 中错误的行之后),并看到我的 web.config 中引用的 aspNetCore 有一个 AspNetCoreModule 处理程序。在查看该站点的 IIS 中的模块时,我注意到缺少 AspNetCoreModule。

    【讨论】:

    猜你喜欢
    • 2017-11-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-13
    • 2021-09-02
    • 2011-06-05
    相关资源
    最近更新 更多