找回密码
 会员注册
查看: 183|回复: 0

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

[复制链接]

1389

主题

5

回帖

496万

积分

管理员

积分
4962990
发表于 2024-2-29 08:34:28 | 显示全部楼层 |阅读模式

报错信息:

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的人

更改后的:

  1. public class Startup
  2. {
  3. public void ConfigureServices(IServiceCollection services)
  4. {
  5. services.AddApplication<CanteenServiceHostModule>();
  6. }
  7. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
  8. {
  9. app.InitializeApplication();
  10. }
  11. }
复制代码

启动成功!


来源:https://blog.csdn.net/PROBIE_/article/details/121487953
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 会员注册

本版积分规则

QQ|手机版|心飞设计-版权所有:微度网络信息技术服务中心 ( 鲁ICP备17032091号-12 )|网站地图

GMT+8, 2024-12-26 13:00 , Processed in 1.959905 second(s), 26 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表