Include x32 or x64 System.Data.SQLite.dll file correctly

南笙酒味 提交于 2019-12-07 09:35:42

问题


I was searching on internet about it but I'm not sure exactly what to do. I found out that I need to include some code in my Program.csproj file.

When I open Program.csproj it says

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <ProjectView>ShowAllFiles</ProjectView>
  </PropertyGroup>

</Project>

this is code which I need to include:

<Reference 
       Include="System, Version=1.0.66.0, Culture=neutral, processorArchitecture=MSIL"  
         Condition=" '$(Platform)' == 'AnyCPU' ">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>library\sqlite\x32\System.Data.SQLite.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference 
         Include="System, Version=1.0.66.0, processorArchitecture=MSIL" 
         Condition=" '$(Platform)' == 'x64' ">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>library\sqlite\x64\System.Data.SQLite.DLL</HintPath>
</Reference>

But I'm not quite sure if this is correct cause my program is taking all dll from it's root directory and not from "library\sqlite\" Could someone please help me to do it correctly? I just can't get it right


回答1:


First of all I strongly recommend you to use v1.0.67+ from http://system.data.sqlite.org

http://system.data.sqlite.org/blobs/1.0.83.0/sqlite-netFx40-binary-Win32-2010-1.0.83.0.zip
http://system.data.sqlite.org/blobs/1.0.83.0/sqlite-netFx40-binary-x64-2010-1.0.83.0.zip

So just extract AnyCPU files from one of two archives (both contain the same version):

System.Data.SQLite.dll
System.Data.SQLite.Linq.dll

While x64 and x86 files (SQLite.Interop.dll) must be copied as follows. On 32-bit operating system

  • file from from sqlite-netFx40-binary-Win32-2010-1.0.xx.0.zip goes in C:\Windows\system32

On 64-bit operating system

  • x64 files goes in C:\Windows\system32
  • Win32 goes in C:\Windows\SysWOW64

.NET will automatically "choose" the right Interop file to include



来源:https://stackoverflow.com/questions/13976248/include-x32-or-x64-system-data-sqlite-dll-file-correctly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!