Loading

HTTP Error 500.30 - ANCM In-Process Start Failure

环境

  • windown 10
  • IIS 10
  • net core 2.2
  • vs2019

背景

在vs2019使用net core 2.2发布到IIS 10上(见在 ASP.NET Core 中使用多个环境),正常是没有问题的。想着使用环境变量进行环境配置,在发布文件上加了一个节点信息:

 <EnvironmentName>Development</EnvironmentName>

20191111-pubxml-file.png

就出现了问题:

20191111-http-error-500.30.png

不明所以,查了一番找到了官网Azure App Service 和 IIS 上的 ASP.NET Core 疑难解答

20191111-http-error-500.30-site.png

哦,可能是共享框架版本不存在,

stdout日志即使改为true也没有日志文件产生,只能看看事件查看器
20191111-iis-event.png

这一串也是看不懂了:

 Application '/LM/W3SVC/2/ROOT' with physical root 'D:\06-IIS\netcore-sample\netcoe.S01.base\' failed to load clr and managed application. CLR worker thread exited prematurely 
   Process Id: 10864. 
   File Version: 12.2.19169.6. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: e7f262e33108e92fc8805b925cc04b07d254118b 

Application '/LM/W3SVC/2/ROOT' with physical root 'D:\06-IIS\netcore-sample\netcoe.S01.base\' failed to load clr and managed application. Unexpected exception: HRESULT 0x800700b7 returned at d:\b\w\da744fbcc13abce\src\servers\iis\aspnetcoremodulev2\inprocessrequesthandler\inprocessapplication.cpp:198  
   Process Id: 10864. 
   File Version: 12.2.19169.6. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: e7f262e33108e92fc8805b925cc04b07d254118b 

github上找到一个相似问题的:2.2.0 IIS Hosting Bundle 500.30 error when setting web.config ASPNETCORE_ENVIRONMENT #5973

似乎没啥用,又根据文中链接找到Duplicate ASPNETCORE_Environment present for InProcess hosting causes ASPNET CORE 2.2 fails to load appsettings #4566

也没啥用! asp.net core的团队开发者说解决了!英文不好借助翻译看了很久也没找到答案。

是装了net core 2.2的错?

之前这个方法我一直在用,使用net core 2.1.1是没有问题,安装了net core 2.2原先net core 2.1.1的项目也不能这种方式在IIS上部署了?

删除所有runtmie和sdk

官方说是共享库问题,于是我将所有的net coreruntime,sdk以及hosting尽数删除,只安装net core 2.2仍然不行。

至此这个问题一直无解!......

net core 3.0

使用net core 3.0 版本,这个问题就不会出现。

posted @ 2019-11-19 10:42  牧白  阅读(11112)  评论(3编辑  收藏  举报