【发布时间】:2019-01-09 12:05:35
【问题描述】:
我确实将我的应用程序升级到了 aspnetcore 2.2,但由于一些我计划稍后删除的遗留限制,我必须以 .NET Framework 为目标。
新的托管模型 InProcess 带来了改进,所以我想使用它,但是当我部署到 azure 时出现错误。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<!--AspNetCoreModuleV2 switch back when its released on azure-->
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\Flymark.Online.Web.exe" arguments="" stdoutLogEnabled="true" stdoutLogFile="../stdout" hostingModel="InProcess" />
</system.webServer>
</location>
</configuration>
我的错误
HTTP 错误 500.0 - ANCM 进程内处理程序加载失败常见原因 此问题的:Microsoft.NetCore.App 的指定版本或 未找到 Microsoft.AspNetCore.App。处理中的请求 处理程序 Microsoft.AspNetCore.Server.IIS 未在 应用。 ANCM 找不到 dotnet。故障排除步骤:检查 错误消息的系统事件日志 启用记录应用程序 进程的标准输出消息 将调试器附加到应用程序进程 并检查更多信息,请访问: https://go.microsoft.com/fwlink/?LinkID=2028526
如果我将同一个应用程序更改为进程外并将模块更改为 v1,它会按预期工作
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<!--AspNetCoreModuleV2 switch back when its released on azure-->
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\Flymark.Online.Web.exe" arguments="" stdoutLogEnabled="true" stdoutLogFile="../stdout" hostingModel="OutOfProcess" />
</system.webServer>
</location>
</configuration>
我正在使用 Azure 管道和 MSbuild 发布我的应用程序。
【问题讨论】:
-
将 modules="AspNetCoreModuleV2" 更改为 modules="AspNetCoreModule" 也对我有用。 (并不是说这是正确的做法!)但这对我有用。
-
@Henke 如果您仔细阅读标题,您会发现我说“目标 .net 框架”,其他问题说使用“.netcore”
-
@VolodymyrBilyachat,我完全同意。我的错误和道歉。我相信您接受的自我回答是正确的。而且你对 Kinjal Parmar 的评论是正确的,说the In-Process IIS hosting model will most likely never be supported for the .NET Framework。 (如果你想知道为什么我之前没有回答 - 我的声誉不早于今天。:-))
标签: c# azure iis asp.net-core