asp.net core 2.1程序部署到IIS报错502.5解决方案

百度了好多方案都不行,突然设置了一下这个,解决了,这个症状是在服务器上用localhost加端口可以访问,但是外网不行,显示502.5错误

原文:https://www.cnblogs.com/cglandy/p/cglandy_dotnetcore_1.html

.netcore 2.1.4的程序部署到IIS后报以下错误:

=======================================================

HTTP Error 502.5 - Process Failure

Common causes of this issue:
The application process failed to start
The application process started but then stopped
The application process started but failed to listen on the configured port

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=808681

 

解决方案,选中应用程序池-->高级设置-->加载用户配置文件设为true.

问题原因:IIS默认是不读取我们.netcore的配置文件appsettings.json,如下图命令执行donet path/application.dll时会出现错误提示:

找到对应的行发现是因为找不到对应的配置导致Object reference not set to an instance of an object.

修改应用程序池的设置后,问题解决。

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值