Search code examples
c#winformssqlitepublish

SQLite.Interop.dll error when publishing application


I am trying to publish a WinForms c# application, but whenever I do, regardless of x86 or x64, I get an error on the target machine, saying that the .dll is missing. I have tried various solutions, but nothing seems to work, from adding the files manually, to switching the output to either x86 or x64, nothing works; the file doesn't get created if I publish it.

The only thing that actually works, is if I copy the whole of the release/debug folder on the target machine. That, however, is undesirable, as I don't want the user to actually have/see all those files. How do I solve the error?


Solution

  • To create a new setup project

    • On the File menu, point to Add, then click New Project.
    • In the resulting Add New Project dialog box, in the Project Types pane, open the Other Project Types node, open Setup and Deployment Projects, and select Visual Studio Installer.
    • In the Templates pane, choose Setup Project for a standard setup, or Web Setup Project for a Web application.

    To add an existing setup project to a solution

    • On the File menu, point to Add, then click Existing Project.
    • In the resulting Add Existing Project dialog box, browse to the location of the setup project and click Open.