问题发布与回答 发表于 2021-5-1 22:11:13

Could not load file or assembly 'System.Data.SQLite' or one of its dependenci...

今天在一个服务器(winserver 2008 R2 x64)上新建了一个IIS(7) 网站,但是报了如下错误:
Could not load file or assembly 'System.Data.SQLite' or one of its dependencies. An attempt was made to load a PRogram with an incorrect format.
如下图:

刚开始以为Bin下面System.Data.SQLite.dll 不存在,其实Bin的SQLite文件存在的。
  也考虑到是权限问题,设置了所有权限还是报错;
然后又尝试了应用程序池.NET版本等其他方式,还是没找到原因;
最后在网上搜索到了解决办法,原来应用程序池的**选项里面有关于兼容WIN32程序的选项;
System.Data.SQLite是分了操作系统版本的,有X86,X64之分;因此应用程序池应该选择兼容WIN32;
如图所示,这样设置后,网站就不报错了
页: [1]
查看完整版本: Could not load file or assembly 'System.Data.SQLite' or one of its dependenci...