Sqlite.Net的使用

1.两个网站:  http://system.data.sqlite.org目前下载到最新版本1.0.76.0  , October 4, 2011。

      http://sqlite.phxsoftware.com/只有版本1.066.0   ,April 18, 2010。

http://sourceforge.net/projects/sqlite-dotnet2/files/的版本:Looking for the latest version? Download SQLite-1.0.66.0-setup.exe (3.2 MB)

  安装了: sqlite-netFx40-setup-bundle-x86-2010-1.0.76.0.exe

2. 1.0.66.0安装到c:\program files\SQLite.NET\,   1.0.76.0安装到c:\program files\System.Data.SQLite\

3. 1.0.66.0的目录c:\program files\SQLite.NET\bin\Designer\Install.exe运行后提供对VS的设计时支持,包括2010.

     1.0.76.0从readme.html 看暂不支持?

4. 错误

1.0.77.0的bin中运行test.exe发生“未能加载文件或程序集“System.Data.SQLite, Version=1.0.76.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139”或它的某一个依赖项。生成此程序集的运行时比当前加载的运行时新,无法加载此程序集。”错误。

加入:

     <startup useLegacyV2RuntimeActivationPolicy="true">
      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    </startup> 解决。

5. 错误

System.Data.ProviderIncompatibleException: 对类型“System.Data.SQLite.SQLiteFactory”的存储区提供程序实例调用“GetService”方法后,返回 null。存储区提供程序可能未正常运行。

6. 错误

混合模式程序集是针对“v2.0.50727”版的运行时生成的,在没有配置其他信息的情况下,无法在 4.0 运行时中加载该程序集。App.Config加:

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

注意:vs2008的项目用VS2010升级为.Net FrameWork4.0后自动生成了App.config,有下面一条配置必须改成上面的配置,否则同样有上面的错误。

  <startup>
      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    </startup>


  

原文地址:https://www.cnblogs.com/z1971/p/2252463.html