【发布时间】:2020-02-18 10:04:12
【问题描述】:
我正在将现有的 ASP.NET Core 2.2 应用程序升级到 3.0。
当我在本地 IIS 中发布和托管我的 API 时,我得到 HTTP 错误 502.5 - 进程失败页面。关键是,我没有看到日志被写入stdoutLogFile 位置。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\bin\MyApplication.dll" stdoutLogEnabled="true" stdoutLogFile=".\bin\Logs\" hostingModel="inprocess" />
</system.webServer>
</configuration>
我已通过以下配置将输出文件夹从 \bin\Debug\netcoreapp3.0\ 更改为 \bin\:
<PropertyGroup>
<OutputPath>.\bin</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
</PropertyGroup>
我的\bin\ 文件夹中还有一个名为Logs 的文件夹。
但是当我调用我的 API 时,我在 Error Viewer 中得到了这个错误:
警告:无法创建 stdoutLogFile C:\PathToMyProjectFile\bin\Debug\netcoreapp2.2_19212_2019102292022.log, 错误代码 = -2147024893。
关键是,我不再使用 2.2。我该如何解决这个问题?
【问题讨论】:
标签: asp.net-core iis web-config asp.net-core-3.0