1. 程式人生 > >C# 引入Sqlite 未能加載文件或程序集“System.Data.SQLite

C# 引入Sqlite 未能加載文件或程序集“System.Data.SQLite

token 地址 system 通過 博客 ckey 一個 sql 它的某一個依賴項


個人博客 地址:https://www.wenhaofan.com/article/20190501224046

問題

在Visual Studio 中 使用NuGet 通過 install-package system.data.sqlite.x64 安裝了64位的sqlite但是在使用中報如下錯誤

System.BadImageFormatException:“未能加載文件或程序集“System.Data.SQLite, Version=1.0.110.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139”或它的某一個依賴項。試圖加載格式不正確的程序。”

解決方法

導航欄選擇項目-》【項目名】屬性 -》 生成 在常規中將目標平臺改為x64,如果你安裝的是32位的sqlitename就選擇 x86

C# 引入Sqlite 未能加載文件或程序集“System.Data.SQLite