gpt4 book ai didi

c# - HTTP 错误 500.32 - 将独立的 .Net Core 3.1 应用程序部署到 Azure 后,ANCM 无法加载 dll

转载 作者:行者123 更新时间:2023-12-04 00:21:48 25 4
gpt4 key购买 nike

我有一个 Asp .NET Core 3.1 应用程序,已部署到 Azure 应用服务(基于西欧/Windows)。当我使用依赖于框架的部署模式时,应用程序启动顺利。

但是,当我尝试切换到独立部署时,应用程序无法启动,并且收到错误消息:HTTP 错误 500.30 - ANCM 进程内启动失败

将运行时从 win-x86 更改为 x64 并没有解决问题。

我检查了安装的应用程序服务器运行时版本,看起来运行时可用(参见下面的屏幕截图)。

我做错了什么?

Server Installed Runtimes

最佳答案

对于 .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>

编辑 22 年 7 月 12 日

在新网站上发现 .net 7 也是如此。您将在此处看到.net 7,并且在 csproject 中我放置了 AspNetCoreHostingModel 和值 OutOfProcess,这意味着当您发布它时,它总是可以的,之后无需再编辑 web.config。

<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>

</PropertyGroup>

关于c# - HTTP 错误 500.32 - 将独立的 .Net Core 3.1 应用程序部署到 Azure 后,ANCM 无法加载 dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60073546/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com