.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還原相關的依賴包。