引用sqlite的程序集時,有時會報如下異常:
“System.BadImageFormatException”類型的未經處理的異常在 PurchaseDevices.Access.dll 中發生
其他信息: 未能加載文件或程序集“System.Data.SQLite, Version=
1.0.66.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139”或它的某一個依賴項。試圖加載格式不正確的程序。
其他信息: 未能加載文件或程序集“System.Data.SQLite, Version=

解決方案:在配置文件中添加如下代碼
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku = ".NETFramework,Version=v4.0"/>
<supportedRuntime version="v2.0.50727"/>
</startup>
<supportedRuntime version="v4.0" sku = ".NETFramework,Version=v4.0"/>
<supportedRuntime version="v2.0.50727"/>
</startup>