升级到ASP.NET Core 3.0后,我得到“无法创建stdoutLogFile ErrorCode = -2147024893。”

问题描述 投票:0回答:1

我将现有的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时,我在Error Viewer中收到此错误:

警告:无法创建stdoutLogFileC:\ PathToMyProjectFile \ bin \ Debug \ netcoreapp2.2_19212_2019102292022.log,错误代码= -2147024893。

重点是,我不再使用2.2。我该如何解决?

asp.net-core iis web-config asp.net-core-3.0
1个回答
0
投票

您必须通过删除modules =“ AspNetCoreModuleV2”中的“ V2”来修改生成的web.config,以便具有:modules =“ AspNetCoreModule”。希望对您有所帮助

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.