.net core 3.1 發佈到Centos (linux)系統問題BadImageFormatException

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

發佈了174 篇原創文章 · 獲贊 33 · 訪問量 74萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章