gpt4 book ai didi

.net - 无法检索日志记录设置 - IIS web.config .Net Core 1.1

转载 作者:行者123 更新时间:2023-12-02 17:19:41 25 4
gpt4 key购买 nike

当我尝试浏览到我的 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 Runtime 的方式出错,但是当我从命令行运行命令 dotnet MyWebsite.dll 时,我的网站运行正常。

感谢任何想法/帮助,谢谢!

最佳答案

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

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

关于.net - 无法检索日志记录设置 - IIS web.config .Net Core 1.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43928427/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com