当前位置:   article > 正文

.net core web api启动报错(HTTP Error 500.30 - ASP.NET Core app failed to start)

http error 500.30 - asp.net core app failed to start

报错信息:

HTTP Error 500.30 - ASP.NET Core app failed to start
Common solutions to this issue:
The app failed to start
The app started but then stopped
The app 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

日志:

[FTL] IdentityService.Host terminated unexpectedly!
System.InvalidOperationException: Could not find singleton service: Volo.Abp.Modularity.IModuleContainer, Volo.Abp.Core, Version=4.4.4.0, Culture=neutral, PublicKeyToken=null

事件查看器:

1,Application ‘/LM/W3SVC/11/ROOT’ with physical root ‘D:\core\LogisticsSource\microservices\CanteenService.Host’ failed to load coreclr. Exception message: CLR worker thread exited prematurely
Process Id: 16568.
File Version: 15.0.21133.7. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: 67acc3d331454956fc06d6de2218a625e3e596f8

,2,Application ‘/LM/W3SVC/11/ROOT’ with physical root ‘D:\core\LogisticsSource\microservices\CanteenService.Host’ has exited from Program.Main with exit code = ‘0’. Please check the stderr logs for more information.
Process Id: 16568.
File Version: 15.0.21133.7. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: 67acc3d331454956fc06d6de2218a625e3e596f8

解决:

程序的启动文件startup文件中内容出错
因为我是复制的上一个项目,其中包含了上一个项目的启动配置
直接复制过来造成冲突
改了就行了
这个错也有可能是马虎的原因,可以仔细找找文件内容是不是有书写问题。
这个错也跟少出现,一般不会像我这么马虎
找了两天错
谨以此文献给那些深夜加班努力找bug的人

更改后的:

    public class Startup
    {
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddApplication<CanteenServiceHostModule>();
        }

        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
        {
            app.InitializeApplication();
        }
    }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

启动成功!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/100729
推荐阅读
相关标签
  

闽ICP备14008679号