阅文时长

| 0.69分钟

字数统计

| 1116字符

主要内容

| 1、引言&背景 2、排查思路&解决方案 3、声明与参考资料

『.Net异常:ASP.NET Core does not support multiple apps in the same app pool』

编写人

| SCscHero

编写时间

| 2022/2/5 PM4:16

文章类型

| 系列

完成度

| 已完成

座右铭

每一个伟大的事业,都有一个微不足道的开始。

一、引言&背景   完成度:100%

a) 应对问题

使用.Net5的WebAPI程序启动进入Swagger的Url,发现报了个:ASP.NET Core does not support multiple apps in the same app pool异常。详细异常如下:

HTTP Error 500.35 - ASP.NET Core does not support multiple apps in the same app pool

Common solutions to this issue:
Select a different app pool to host this app.
Specific error detected by ANCM:
Only one in-process application is allowed per IIS application pool. Please assign the application '/LM/W3SVC/3/ROOT/swagger/Index.html' to a different IIS application pool.
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=2028526




.Net异常:ASP.NET Core does not support multiple apps in the same app pool_解决方案


b) 应用场景

  • 基于.Net技术站下的开发场景。
  • 基于Visual Studio2019/2022的IDE下。
  • 寄托于IIS的Debug下。

二、排查思路&解决方案   完成度:100%

a) 排查思路

  1. 结合异常提示以及查阅的资料,发现可能与IIS或VS的BUG有关。
    1.1. 网上一种说法是IIS的App Pool被多个进程重复使用了。于是清理、重建、关闭了解决方案,再重启未果;尝试手动重启IIS App Pool办法,未果。
    1.2. 看到网上一种说法,可能是和动了程序游览器启动设置和App Url有关(此前博主改动过App Url为swagger/Index.html),于是尝试改回去,仍是未果。
  2. 看到网上的一种说法是删除.vs下的文件即可恢复。我们知道.vs文件夹是一些个性化的设置,比如书签、断点设置等都记录在里面,如果全删势必影响较大。
    2.1. 详见本章二节RootCause,删除指定文件。

b) 解决方案

【WorkAround】
不使用IIS的启动方式,使用.Net窗口方式启动。

【RootCause】
删除.vs[AppName]\config\applicationhost.config文件即可。本质原因尚未清晰,总之动了应用程序启动路由容易引发此问题。



.Net异常:ASP.NET Core does not support multiple apps in the same app pool_Visual Studio_02


三、声明与参考资料   完成度:100%

​c# - HTTP Error 500.35 - ANCM Multiple In-Process Applications in same Process ASP.NET Core 3 - Stack Overflow​

原创博文,未经许可请勿转载。