asp.net-core - 升级到 ASP.NET Core 3.0 后,我得到“无法创建 stdoutLogFile 错误代码 = -2147024893”。
问题描述
我正在将现有的 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>
Logs
我的文件夹中还有一个文件\bin\
夹。
但是当我调用我的 API 时,我在错误查看器中收到此错误:
警告:无法创建 stdoutLogFile C:\PathToMyProjectFile\bin\Debug\netcoreapp2.2_19212_2019102292022.log,错误代码 = -2147024893。
关键是,我不再使用 2.2。我应该如何解决这个问题?
解决方案
您必须通过删除 modules="AspNetCoreModuleV2" 中的 "V2" 来修改生成的 web.config,以便拥有: modules="AspNetCoreModule"。希望这可以帮助
推荐阅读
- sql - 如何改进/加速 SQL 查询
- iis - 使用不同别名登录时,相同的 IIS 本地主机标记为不同的名称
- image-processing - 为两个大致相同的蒙版图像创建单应矩阵
- c# - 无法让 costura.fody 将 dll 嵌入 exe
- mysql - MySQL monthly sums
- python - 为什么我的 Python 日志记录设置不起作用?
- python - Python中的键盘模块-停止我的无限while循环
- python - Gmail API socket.timeout:读取操作超时
- python - 如何纠正 MultiIndex.data 弃用
- vue.js - 更改子组件内 ref 的值