錯誤 707 Could not load file or assembly ‘Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKe

錯誤 707 Could not load file or assembly ‘Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

這是一個比較常見的問題,有人直接引用本地程序集,而不是通過NuGet管理包,或者將項目編譯到另一個。net版本中。
解決這個問題的最好方法是在項目引用中找到引用並刪除它,清理項目,檢查DLL是否已經消失,最後使用NuGet重做引用,如下圖
在這裏插入圖片描述