![](/img/trans.png)
[英]Could not load file or assembly 'System.Data.SQLite, Version=1.0.65.0
[英]could not load file or assembly system.data.sqlite on target machine
我有一个 Windows 窗体,连接到一个 sqlite 数据库。
该应用程序在我的电脑上运行良好,但是当我在任何其他电脑上运行它时,我收到以下消息:
could not load file or assembly 'system.data.sqlite, version=1.0.84.0. culture=neutral, publickey token=db937bc2d44ff139' or one of irs dependencies
我试图将 App.xml 更改为:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
</startup>
</configuration>
目标机器安装了 .NET 4.5,问题不在于 .NET,因为该消息只出现在使用 sqlite 的类上。
我尝试安装 Visual C++ 2010 SP1 Redistributable x86,但这并没有解决问题。
但是当我安装 Visual Studio 时,它就像魅力一样。
我应该如何在客户端机器上不安装 Visual Studio 的情况下运行我的应用程序?
SQLite .NET 程序集不是 .NET Framework 或 Visual C++ 2010 SP1 Redistributable x86 的一部分; 您应该将它们与您的应用程序一起部署。
部署程序集的推荐方法是“应用程序本地”(即,将它们复制到应用程序安装到的目录中)
也不要忘记本机互操作 DLL; 你基本上需要像这样部署:
- YourApp.exe
- System.Data.SQLite.dll
- x86/SQLite.Interop.dll
- x64/SQLite.Interop.dll
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.