【发布时间】:2020-02-19 19:37:02
【问题描述】:
我将我的代码发布到了我们的 IIS 服务器,但我收到了这个错误。根据我在网上阅读的许多建议,我安装了 Url rewrite,但似乎无法解决问题。此错误指向 Web.Config,我看不出它有任何问题,因为它也是自动生成的。当我在 Visual Studio 2019 上的 IIS Express 中对其进行测试时,一切正常。知道吗?见下面的代码:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\forms.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
【问题讨论】:
-
检查您的日志。
-
我同意。详细检查您的日志是找到实际问题的唯一方法。
-
C:\inetpub\logs\LogFiles\...下的日志文件没有错误
-
ok,终于拿到了一些日志:#Software: Microsoft Internet Information Services 10.0 #Version: 1.0 #Date: 2020-02-19 20:31:08 #Fields: date time s-ip cs-方法 cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken 2020-02-19 20 :31:08 ::1 GET /forms - 80 - ::1 Mozilla/5.0+(Windows+NT+10.0;+WOW64;+Trident/7.0;+rv:11.0)+like+Gecko - 500 19 13 20
标签: c# iis model-view-controller web-config