Aspnetcore 2.2以.Net Framework为目标,在azure应用程序服务上InProcess失败,错误TTP错误500.0-ANCM进程内处理程序加载失败

Vol*_*hat 11 c# iis azure asp.net-core

我确实将我的应用程序升级到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>
Run Code Online (Sandbox Code Playgroud)

还有我的错误

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>
Run Code Online (Sandbox Code Playgroud)

我正在使用Azure管道和MSbuild发布应用程序。

Vol*_*hat 6

截止到今天,在面向.Net Framework时似乎不支持In-Process。在github上发布

  • @KinjalParmar我正在使用过程。除此之外,没有没有解决方案。 (2认同)