.net core 3.1开发的控制台程序在win7下正常运行,直接发布后复制到linux系统中运行报如下错误:
Unhandled exception. System.BadImageFormatException: Could not load file or assembly '/root/netcoreapp3.0/ProjectFBA_WebApi.dll'. The module was expected to contain an assembly manifest
解决方法:发布时“目标运行时”选项linux-x64,需要联网使用nuget还原相关的依赖包。