Visual Studio C# - SQLite.Interop.dll not found

后端 未结 8 2075
忘了有多久
忘了有多久 2020-12-06 03:22

I am currently trying to create with Visual Studio a C# application working with SQLite. I installed SQLite for my program with NuGet and three references appeared in the So

相关标签:
8条回答
  • 2020-12-06 03:54

    Please use the answer to the duplicate issue: https://stackoverflow.com/a/60176344/3634867

    Don't store the dll yourself and copy it to /bin manually, it will lost control to the version updating and depenedcy.

    TL;DR;

    for old csproj file:

    <PropertyGroup> 
        <ContentSQLiteInteropFiles>true</ContentSQLiteInteropFiles>
        <CopySQLiteInteropFiles>false</CopySQLiteInteropFiles>
        <CleanSQLiteInteropFiles>false</CleanSQLiteInteropFiles>
        <CollectSQLiteInteropFiles>false</CollectSQLiteInteropFiles>
    </PropertyGroup>
    

    for new csporj file: (i.e. projects beginning with <Project Sdk="Microsoft.NET.Sdk.*">)

    <PackageReference Include="System.Data.SQLite.Core" Version="1.0.110" PrivateAssets="none"/>
    
    0 讨论(0)
  • 2020-12-06 03:56

    If it is an installable file. i.e, if u are creating setup file, then you have to add the dll manually to the primary output file.

    Go to properties of the setup project and in configuration settings, select pre-requisites SQLLite, select(Checkbox) install it from the project location.

    See if this solves your issue.

    0 讨论(0)
提交回复
热议问题