简体   繁体   English

为什么要安装Microsoft Visual C ++ 2010 Redistributable Package x86来使用SQLite?

[英]Why install Microsoft Visual C++ 2010 Redistributable Package x86 to use SQLite?

I wrote windows application with C# and SQLite. 我用C#和SQLite编写Windows应用程序。 When Microsoft Visual C++ 2010 Redistributable Package x86 was installed on a PC application runs correctly but if Microsoft Visual C++ 2010 Redistributable Package x86 not install, application doesn't run. 当PC应用程序上安装Microsoft Visual C ++ 2010 Redistributable Package x86正确运行但如果未安装Microsoft Visual C ++ 2010 Redistributable Package x86,则应用程序不会运行。 Why? 为什么?
Is SQLite depend on Microsoft Visual C++ 2010 Redistributable Package x86 ? SQLite依赖于Microsoft Visual C ++ 2010 Redistributable Package x86吗?

SQLite的版本由VS2010编译,并且取决于C运行时库,因此需要Visual C ++ 2010可再发行组件包x86。

Yes. 是。 SQLite is probably written in C++. SQLite可能是用C ++编写的。 It's compiled with /MD option which means it needs the msvcrt#.dlls at runtime. 它使用/ MD选项编译,这意味着它在运行时需要msvcrt#.dlls。 The Restributable Package installs this without which it cannot run Restributable Package会安装它,如果没有它,它就无法运行

Because SQLite obviously developed the SQLite.Interop.dll in C++, and because they say so: 因为SQLite显然在C ++中开发了SQLite.Interop.dll,并且因为他们这样说:

(11) Why do I get a DllNotFoundException (for "sqlite3.dll" or "SQLite.Interop.dll") when trying to run my application? (11)为什么在尝试运行我的应用程序时出现DllNotFoundException(对于“ sqlite3.dll”或“ SQLite.Interop.dll”)?

Either the named dynamic link library (DLL) cannot be located or it cannot be loaded due to missing dependencies. 找不到指定的动态链接库(DLL)或由于缺少依赖项而无法加载该文件。 Make sure the named dynamic link library is located in the application directory or a directory along the system PATH and try again. 确保命名的动态链接库位于应用程序目录或系统PATH的目录中,然后重试。 Also, be sure the necessary Visual C++ runtime redistributable has been installed unless you are using a dynamic link library that was built statically linked to it. 另外,除非使用的是静态链接的动态链接库,否则请确保已安装必要的Visual C ++运行时可再发行组件。

Emphasis mine on that last part. 在最后一部分强调我的。 You need the static binaries from the system.data.sqlite download page in order to NOT need the C++ runtime. 您需要从system.data.sqlite下载页面获取静态二进制文件,以便不需要C ++运行时。 On that same page, where the binaries are provided, those that do require it will tell you it is - for example, the Visual C++ 2010 SP1 runtime for x64 is required for 4.0, and Update 4 of that is needed for .NET 4.5, according to the page. 在提供二进制文件的同一页面上,那些需要它的人会告诉你它 - 例如,4.0版需要x64的Visual C ++ 2010 SP1运行时,而.NET 4.5需要更新4,根据页面。 I've used the 2015 version, Update 3, with the .NET 4.0 versions with no issues. 我已经使用了2015版本的Update 3和.NET 4.0版本,没有任何问题。

Note - you might not be aware, but if you try hosting an application that uses the SQLite DLLs on a file share and connect to that application across the network from a workstation, that workstation will still need the C++ runtime because it is running the application in its memory. 注意 - 您可能不知道,但如果您尝试托管在文件共享上使用SQLite DLL并从工作站通过网络连接到该应用程序的应用程序,该工作站仍将需要C ++运行时,因为它正在运行应用程序在它的记忆中。

Reference: http://system.data.sqlite.org/index.html/doc/trunk/www/faq.wiki#q11 参考: http : //system.data.sqlite.org/index.html/doc/trunk/www/faq.wiki#q11

Link to Microsoft Visual C++ 2015 Redistributable Update 3 , which I know works with the 64-bit, .NET 4.0 versions of the SQLite binaries: https://www.microsoft.com/en-us/download/details.aspx?id=53840 链接到Microsoft Visual C ++ 2015 Redistributable Update 3 ,我知道它与64位.NET 4.0版本的SQLite二进制文件一起使用: https//www.microsoft.com/en-us/download/details.aspx?id = 53840

SQLite depends on the Visual C++ runtime, but you don't need to install it on the client machine. SQLite依赖于Visual C ++运行时,但是您不需要在客户端计算机上安装它。 The system.data.sqlite download page contains several "static" packages that already contain the runtime. system.data.sqlite下载页面包含几个已包含运行时的“静态”包。

All the "static" packages contain either native or mixed-mode assembly binaries linked statically to the appropriate version of the Visual C++ runtime. 所有“静态”包都包含静态链接到Visual C ++运行时的相应版本的本机或混合模式程序集二进制文件。 Typically, these packages are used in cases where customer machines may not have the necessary version of the Visual C++ runtime installed and it cannot be installed due to limited privileges. 通常,这些程序包用于客户机器可能没有安装必要版本的Visual C ++运行时且由于权限有限而无法安装的情况。

For example, on my machine I am running Windows 8.1 x64 so I went under Precompiled Statically-Linked Binaries for 64-bit Windows (.NET Framework 4.0) and downloaded sqlite-netFx40-static-binary-x64-2010-1.0.90.0.zip . 例如,在我的机器上,我运行的是Windows 8.1 x64,因此我使用了预编译的静态链接二进制文件,用于64位Windows(.NET Framework 4.0)并下载了sqlite-netFx40-static-binary-x64-2010-1.0.90.0。拉链

This binary package contains all the binaries for the x64 version of the System.Data.SQLite 1.0.90.0 (3.8.2) package. 此二进制包包含System.Data.SQLite 1.0.90.0(3.8.2)包的x64版本的所有二进制文件。 The Visual C++ 2010 SP1 runtime for x64 is statically linked. x64的Visual C ++ 2010 SP1运行时是静态链接的。 The .NET Framework 4.0 is required. .NET Framework 4.0是必需的。

I then unzipped the package and ran test.exe to make sure everything works. 然后,我解压缩该软件包并运行test.exe以确保一切正常。 Zero installation required. 需要零安装。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Api-ms-win-core-crt-l1-1-0.dll - Microsoft Visual C++ 2015 Redistributable(vc_redist.x64.exe 和 vcredist_x86.exe)无法安装 - Api-ms-win-core-crt-l1-1-0.dll - Microsoft Visual C++ 2015 Redistributable (vc_redist.x64.exe and vcredist_x86.exe) fails to install Microsoft Visual C ++ 2010 SP1可在Azure上重新分发吗? - Microsoft Visual C++ 2010 SP1 Redistributable on Azure? 为什么需要在Visual Studio 2010中更改X86平台 - Why Required to chage X86 Platform in Visual Studio 2010 我是否需要为我的powerpoint加载项安装用于Office运行时的Microsoft Visual Studio 2010工具(x86和x64)? - Do I need to install Microsoft Visual Studio 2010 Tools for Office Runtime (x86 and x64) for my powerpoint Add-in? 使用单个Visual Studio解决方案同时为C ++ / CLI项目构建x86和x64 - Use a single Visual Studio solution to build both x86 and x64 at the same time for C++/CLI project 在位置 C:\\Program Files (x86)\\Microsoft Visual Studio 11.0 找不到 ildasm.exe - Could not find ildasm.exe at location C:\Program Files (x86)\Microsoft visual studio 11.0 GetCurrentDirectory返回“ C:\\\\ Program Files(x86)\\\\ Microsoft Visual Studio 12.0 \\\\ Common7 \\\\ IDE” - GetCurrentDirectory returns “C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\IDE” VS2017加载手动配置为x86的C++项目作为VS2010项目 - VS2017 loads C++ project that was manually configured to x86 as a VS2010 project Visual Studio 2010只有x86构建选项吗? - Visual Studio 2010 only x86 build option? 如何检查设备上是否安装了 Microsoft Visual C++ 2015 Redistributable - How to Check if Microsoft Visual C++ 2015 Redistributable Installed on a Device
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM