2012-12-20 48 views
4

我在網上搜索有關它,但我不知道該怎麼辦。 我發現我需要在我的Program.csproj文件中包含一些代碼。正確包含x32或x64 System.Data.SQLite.dll文件

當我打開Program.csproj它說

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

</Project> 

這是代碼,我需要包括:

<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> 

但我不能肯定這是否是正確的事業我的程序從它的根目錄中取出所有dll,而不是從「library \ sqlite \」 有人可以幫助我正確地做到這一點嗎?我只是無法得到它的權利

回答

3

首先,我強烈建議你使用v1.0.67 +從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 

所以只是從兩個檔案的一個提取AnyCPU文件(包含相同版本):

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

雖然x64和x86文件(SQLite.Interop.dll)必須複製如下。 在32位操作系統

  • 文件從sqlite-netFx40-binary-Win32-2010-1.0.xx.0.zip進去 C:\ Windows \ System32下

在64位操作系統

  • 64文件雲在C:\ Windows \ System32下
  • Win32的推移在C:\ WINDOWS \ SysWOW64中

.NET將自動「選擇」正確的Interop文件以包含