HTTP Error 500.30 - ANCM In-Process Start Failure
Common causes of this issue:
The application failed to start
The application started but then stopped
The application started but threw an exception during startup
Troubleshooting steps:
Check the system event log for error messages
Enable logging the application process' stdout messages
Attach a debugger to the application process and inspect
For more information visit: https://go.microsoft.com/fwlink/?LinkID=2028265
1
2
3
4
5
6
7
8
9
10
可以按照报错提示查看更改信息 Azure App Service 和 IIS 上的 ASP.NET Core 疑难解答 | Microsoft Docs。
其实按照现有的提示可以了解到错误原因,进程内启动失败,改为进程外托管即可。
500.30 进程内启动失败
工作进程失败。 应用不启动。
ASP.NET Core 模块尝试在进程中启动 .NET Core CLR,但无法启动。 通常,可以根据应用程序事件日志中的条目和 ASP.NET Core 模块 stdout 日志中的条目来确定进程启动失败的原因。
常见的失败情况是,由于目标 ASP.NET Core 共享框架版本不存在,因此应用配置错误。 检查目标计算机上安装的 ASP.NET Core 共享框架版本。
根据 ASP.NET Core 模块 | Microsoft Docs 可知,默认配置是进程内托管,设为 InProcess,显示指定Web项目为进程外托管
<PropertyGroup>
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
</PropertyGroup>
1
2
3
分析报错原因:
报错的web.config配置文件如下
<?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=".\JobWanted.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: f0cca8c5-a238-40ff-9989-476b54dc1e72-->
1
2
3
4
5
6
7
8
9
10
11
12
注意processPath,作用是为 HTTP 请求启动进程侦听的可执行文件的路径。
processPath=".\JobWanted.exe" 说明 Web需要请求转发给 Kestrel 服务器
根据 ASP.NET Core 模块 | Microsoft Docs 开篇的介绍,显然应该使用进程外托管模型。
ASP.NET Core 模块是插入 IIS 管道的本机 IIS 模块,用于:
在 IIS 工作进程 (w3wp.exe) 内托管 ASP.NET Core 应用,称为进程内托管模型。
将 Web 请求转发到运行 Kestrel 服务器的后端 ASP.NET Core 应用,称为进程外托管模型。
配置进程外托管模型,重新发布之后web.config文件内容变更如下。
<?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=".\JobWanted.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="OutOfProcess" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: f0cca8c5-a238-40ff-9989-476b54dc1e72-->
1
2
3
4
5
6
7
8
9
10
11
12
再次访问,问题解决!
参考:HTTP Error 500.30 - ANCM In-Process Start Failure 解决方法 - 妖精的尾巴
————————————————
版权声明:本文为CSDN博主「repeatedly」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/u014654707/article/details/103580395