简体   繁体   English

HTTP 错误 500.32 - 将自包含 .Net Core 3.1 应用程序部署到 Azure 后,ANCM 无法加载 dll

[英]HTTP Error 500.32 - ANCM Failed to Load dll after deploying a Self Contained .Net Core 3.1 App to Azure

I have an Asp .NET Core 3.1 App which is deployed to Azure App Service (West Europe/Windows based).我有一个部署到 Azure 应用服务(基于西欧/Windows)的 Asp .NET Core 3.1 应用程序。 When I use a Framework dependendant Deployment Mode, the app is starting smoothly.当我使用依赖于框架的部署模式时,应用程序启动顺利。

But, when I try to switch to a Self Contained deployment, the App fails to start and I get an error message : HTTP Error 500.30 - ANCM In-Process Start Failure但是,当我尝试切换到自包含部署时,应用程序无法启动并收到一条错误消息: HTTP 错误 500.30 - ANCM 进程内启动失败

Changing the Runtime from win-x86 to x64 didn't solve the problem.将运行时从 win-x86 更改为 x64 并没有解决问题。

I inspected the App Server runtime versions installed and it looks like runtimes are available (cf. screenshot below).我检查了安装的 App Server 运行时版本,看起来运行时可用(参见下面的屏幕截图)。

What am I doing wrong?我究竟做错了什么?

服务器安装的运行时

In case the above does not resolve your issue, and in case you missed it within https://github.com/dotnet/aspnetcore/issues/8980 , but this solved my issue.如果上述内容不能解决您的问题,并且您在https://github.com/dotnet/aspnetcore/issues/8980 中错过了它,但这解决了我的问题。

Per DimaSUN commented on Jun 25, 2019: Per DimaSUN 在 2019 年 6 月 25 日评论:

ASP.NET Core 2.2 or later: For a 64-bit (x64) self-contained deployment that uses the in-process hosting model, disable the app pool for 32-bit (x86) processes. ASP.NET Core 2.2 或更高版本:对于使用进程内托管模型的 64 位 (x64) 自包含部署,禁用 32 位 (x86) 进程的应用程序池。

How to: Open Application Pool within IIS.如何:在 IIS 中打开应用程序池。 Select the website > Advanced Settings.选择网站 > 高级设置。 Set 32-bit Applications from True to False.将 32 位应用程序从 True 设置为 False。

For .net 5 the issue is the same I had to remove the hostingModel="inprocess" from the web.config so it read the following对于 .net 5,问题是相同的,我必须从 web.config 中删除 hostsModel="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>

Have you tried adding .Net Core 3.1 extension in your app service?您是否尝试过在您的应用服务中添加 .Net Core 3.1 扩展? Development Tools -> Extensions -> Add -> Asp.Net Core 3.1 with the runtime you require.开发工具 -> 扩展 -> 添加 -> Asp.Net Core 3.1 以及您需要的运行时。

I had the same issue yesterday and after adding the extension, the problem was gone.我昨天遇到了同样的问题,添加扩展后,问题就消失了。

In the event it helps anyone else... I still had UseKestrel() in my Program.cs (which makes sense given that others mentioned the hosting model as the culprit ).如果它可以帮助其他任何人......我的Program.cs仍然有UseKestrel() (考虑到其他人提到托管模型是罪魁祸首,这是有道理)。

public static IHostBuilder CreateHostBuilder(string[] args) =>
    Host.CreateDefaultBuilder(args)
        .ConfigureWebHostDefaults(webBuilder => {
            webBuilder.UseKestrel(k => k.AddServerHeader = false);
            webBuilder.UseStartup<Startup>();
        });

Removing Kestrel (naturally) alleviates the problem.移除 Kestrel(自然地)可以缓解这个问题。

I also eventually saw this in the Kudu Debug Console ...我最终也在Kudu 调试控制台中看到了这一点......

Application is running inside IIS process but is not configured to use IIS server应用程序在 IIS 进程内运行,但未配置为使用 IIS 服务器

Completely unrelated to the troubleshooting tips this error provides, this can also be caused by insufficient permissions of the app pool account on the source directory of the .NET Core application.此错误提供的故障排除提示完全无关,这也可能是由于应用程序池帐户对.NET Core应用程序源目录的权限不足造成的。

When the service account only had Read permissions I got this error.当服务帐户只有读取权限时,我收到此错误。 After adding Read & Execute permissions (since the application is an .exe ) the error went away.添加读取和执行权限后(因为应用程序是.exe ),错误消失了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP.NET 内核 3.1 HTTP 错误 500.32 - ANCM 无法在 Z5165ACF41601B5EB4EC2 上加载 dll - ASP.NET Core 3.1 HTTP Error 500.32 - ANCM Failed to Load dll on IIS 在 Azure 上部署的 .Net Core 3.1 Web 应用程序显示错误 HTTP 错误 500.35 - ANCM Multiple In-Process Applications in same Process - Deployed .Net Core 3.1 Web app on Azure shows error HTTP Error 500.35 - ANCM Multiple In-Process Applications in same Process IIS 和 NET Core HTTP 错误 500.30 - ANCM 进程中启动失败 .net 核心 3.1 - IIS and NET Core HTTP Error 500.30 - ANCM In-Process Start Failure .net core 3.1 部署到应用服务 .Net Core 3.1、React 后出现 413 错误 - 413 error after deploying to app service .Net Core 3.1, React HTTP 错误 500.30 - ANCM 进程中启动失败 Asp.net-Core 3.1 - HTTP Error 500.30 - ANCM In-Process Start Failure Asp.net-Core 3.1 ASP.NET 核心 3.1 - HTTP 错误 500.30 - ANCM 进程中启动失败 - ASP.NET Core 3.1 - HTTP Error 500.30 - ANCM In-Process Start Failure 将 ASP.NET CORE 3.1 MVC 应用程序部署到 azure 时出现问题 - Problem deploying ASP.NET CORE 3.1 MVC app to azure .net 核心无法作为独立应用程序运行。 在 docker - .net core Failed to run as a self-contained app. on a docker ASP.NET Core 3 Web应用程序,Azure App Service和ANCM进程内处理程序加载失败 - ASP.NET Core 3 Web Application, Azure App Service, and a ANCM In-Process Handler Load Failure .NET 内核 HTTP 错误 500.0 - ANCM 进程内处理程序加载失败 - .NET Core HTTP Error 500.0 - ANCM In-Process Handler Load Failure
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM