我正在尝试在Windows 10 v1903上托管基于.NET Core v2.2构建的Web API。
我已经安装了IIS,它正在运行。 我已经安装了.NET Core Hosting Bundle。
我已将输出从publish文件夹复制到inetpub / wwwroot下的文件夹: Reaching quota too soon on Youtube Data API V3 - optimizing search.list
我已经在IIS中创建了一个网站:
该网站正在使用具有“无托管代码” CLR的应用程序池:
这是我的web.config:
<?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=".\MyAPI.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: 3840a856-efc8-4efc-b593-556179293e4e-->
当我尝试浏览该站点时,它给了我500内部服务器错误。
日志:
#Software: Microsoft Internet Information Services 10.0
#Version: 1.0
#Date: 2020-02-04 01:32:33
#Fields: date time s-ip cs-method 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-04 01:32:33 ::1 GET / - 5050 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36 - 500 19 13 514
2020-02-04 01:32:33 ::1 GET /favicon.ico - 5050 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36 http://localhost:5050/ 500 19 13 0
2020-02-04 01:32:37 ::1 GET /swagger - 5050 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36 - 500 19 13 0
2020-02-04 01:32:37 ::1 GET /favicon.ico - 5050 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36 http://localhost:5050/swagger 500 19 13 1
2020-02-04 01:33:02 ::1 GET /myapi/swagger - 5050 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36 - 500 19 13 0
2020-02-04 01:33:02 ::1 GET /favicon.ico - 5050 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36 http://localhost:5050/myapi/swagger 500 19 13 2
2020-02-04 01:33:09 ::1 GET / - 5050 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36 - 500 19 13 1
2020-02-04 01:33:09 ::1 GET /favicon.ico - 5050 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36 http://localhost:5050/ 500 19 13 0
#Software: Microsoft Internet Information Services 10.0
#Version: 1.0
#Date: 2020-02-04 02:58:25
#Fields: date time s-ip cs-method 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-04 02:58:25 ::1 GET / - 5050 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36 - 500 0 0 4473
2020-02-04 02:58:29 ::1 GET /swagger - 5050 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36 - 500 0 0 5
2020-02-04 02:58:37 ::1 GET /MyAPI/swagger - 5050 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36 - 500 0 0 4
2020-02-04 02:58:40 ::1 GET /MyAPI - 5050 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36 - 500 0 0 3
#Software: Microsoft Internet Information Services 10.0
#Version: 1.0
#Date: 2020-02-04 02:59:15
#Fields: date time s-ip cs-method 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-04 02:59:15 ::1 GET / - 5050 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36 - 500 0 0 1340
2020-02-04 02:59:18 ::1 GET /swagger - 5050 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36 - 500 0 0 4
2020-02-04 02:59:27 ::1 GET /MyAPI/swagger - 5050 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36 - 500 0 0 3
#Software: Microsoft Internet Information Services 10.0
#Version: 1.0
#Date: 2020-02-04 03:18:09
#Fields: date time s-ip cs-method 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-04 03:18:09 ::1 GET / - 5050 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36 - 500 0 0 1836
2020-02-04 03:18:12 ::1 GET /swagger - 5050 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/79.0.3945.130+Safari/537.36 - 500 0 0 5
有什么想法吗?