linux下.net core找不到文件System.Private.ServiceModel

将基于.NET Core 3.1的Windows开发的WebAPI部署到CentOS 8.2时,遇到500错误,原因是无法找到System.Private.ServiceModel文件。通过分析日志确定是SOAP调用其他web service时引发的问题。解决方案是在发布目录的runtimes子目录下找到System.Private.ServiceModel.dll并将其放在API站点根目录。
摘要由CSDN通过智能技术生成

一、现象

    将在windows开发环境下正常运行的.net core webapi程序部署到centOS下,调用部分API时出现500错误。

二、环境

  1. .NET Core 3.1
  2. CentOS 8.2
  3. Supervisor 4.2

三、问题解决

1.查看日志文件

    因为通过Supervisor 监控,根据Supervisor 配置文件,找到日志文件。

stderr_logfile=/var/log/supervisor/Sudo.Sms.WebApi.err.log ; 错误日志文件
stdout_logfile=/var/log/supervisor/Sudo.Sms.WebApi.out.log ; 输出日志文件

    发现输出日志文件中有如下问题:

Connection id “0HM4EIP97R2BN”, Request id “0HM4EIP97R2BN:00000001”: An
unhandled exception was thrown by the application.
System.IO.FileNotFoundException: Could not load file or assembly
‘System.Private.ServiceModel, Version=4.1.2.4, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a’. The system cannot find the file
specified.

File name:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值