我将现有的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。我该如何解决?
您必须通过删除modules =“ AspNetCoreModuleV2”中的“ V2”来修改生成的web.config,以便具有:modules =“ AspNetCoreModule”。希望对您有所帮助