我有一个 Asp.NET Core 3.1 应用程序部署到 Azure 应用服务(基于西欧 / Windows)。当我使用依赖于框架的部署模式时,应用程序顺利启动。
但是,当我尝试切换到自包含部署时,应用程序无法启动,并且收到错误消息:HTTP 错误 500.30-ANCM 进程内启动失败
将运行时从 win-x86 更改为 x64 并没有解决问题。
我检查了安装的应用程序服务器运行时版本,它看起来像运行时可用(参见下面的截图)。
我做错了什么?
如果上面没有解决您的问题,如果您在https://github.com/dotnet/aspnetcore/issues/8980中错过了它,但这解决了我的问题。
Per DimaSUN 于 2019 年 6 月 25 日发表评论:
ASP.NET Core 2.2 或更高版本:对于使用进程内宿主模型的 64 位 (x64) 自包含部署,请为 32 位 (x86) 进程禁用应用程序池。
如何:在 IIS 中打开应用程序池。选择网站 & gt;高级设置。将 32 位应用程序从 True 设置为 False。
对于.net 5 的问题是一样的,我不得不从 web.config 中删除 hostingModel =“inprocess”,所以它读取以下内容
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\Hub.WebApi.exe" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</location>
</configuration>
您是否尝试在应用服务中添加.Net Core 3.1 扩展?开发工具-& gt;扩展-& gt;添加-& gt;Asp.Net Core 3.1 与您需要的运行时。
我昨天有同样的问题,添加扩展后,问题就消失了。
在事件中,它可以帮助任何人...我仍然有UseKestrel()
在我的Program.cs
(这是有道理的,因为others mentioned the hosting model as the culprit)。
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => {
webBuilder.UseKestrel(k => k.AddServerHeader = false);
webBuilder.UseStartup<Startup>();
});
去除 Kestrel(自然)缓解了这个问题。
我最终也在Kudu Debug Console中看到了这一点...
应用程序正在 IIS 进程内运行,但未配置为使用 IIS 服务器
本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处
评论列表(52条)