.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
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();
        }
    }

启动成功!

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

PROBIE_

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值