VS2012 连接 SQLite

<?xml version="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
  <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>

加载上System.Data.SQLite.DLL后,运行程序,出错

Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

因为System.Data.SQLite.DLL是2.0,而程序是4.0,解决办法,配置文件改为兼容模式即可。

app.config:如上

原文地址:https://www.cnblogs.com/sshoub/p/2518773.html