就是下面这个样子 
Could not load file or assembly 'System.Data.SQLite' or one of its dependencies. 试图加载格式不正确的程序。 但是我检查 bin文件下确实存在这个文件阿

解决方案 »

  1.   

    是不是64bit和x86不兼容参考:
    System.Data.SQLite.dll is a mixed assembly, i.e. it contains both managed code and native code. Therefore a particular System.Data.SQLite.dll is either x86 or x64, but never both.Update (courtesy J. Pablo Fernandez): Cassini, the development web server used by Visual Studio when you press F5 or click the green «play» button, is x86 only which means that even if your workstation is x64, you'll only be able to use the x86 version of System.Data.SQLite.dll.An alternative is not to use Cassini but IIS7 which is properly x64.来自:
    http://stackoverflow.com/questions/1278929/could-not-load-file-or-assembly-system-data-sqlite
      

  2.   

    检查DLL 是否兼容你的操作系统。
      

  3.   

    1 GAC没有注册 System.Data.SQLite.DLL和System.Data.SQLite.Linq.DLL2 Machine.config的DBProviderFactories没有正确增加SQLite相关项。参考:http://blog.csdn.net/liufan76/article/details/3173282
      

  4.   

    我帮你翻译一下,不知道对不对,但我大概明白这个意思:
    System.Data.SQLite.dll是一个混合的程序集,包括托管代码和原生代码。因此一个指定的System.Data.SQLite.dll要么只能运行在32位的操作系统上,要么只能运行在64位的操作系统上,不可能同时运行在二个环境中。当你在vs的开发环境中运行时所启用的是开发用的web服务器Cassini,因此,无论你开发环境用的机器是不是64位的,都只能使用System.Data.SQLite.dll的32位版本。但是可以使用IIS7来替代Cassini,它可以正常使用System.Data.SQLite.dll的64位版本。