1

I have C# app that uses SQLite. It already worked but I've been playing with it and it no longer works and I don't know what's wrong :-/

It compiles OK but I have problem "Could not load 'System.Data.SQLite.dll' or one of its dependencies (on non-dev machine). It's a service that starts during installation so installation fails due to this error.

So I added System.data.sqlite reference. I must note there are no "x86" and "x64" anymore in solution explorer :-/

Package manager console shows it's installed:

PM> Install-Package System.Data.Sqlite
Attempting to resolve dependency 'System.Data.SQLite.Core (≥ 1.0.94.0)'.
Attempting to resolve dependency 'System.Data.SQLite.Linq (≥ 1.0.94.1)'.
Attempting to resolve dependency 'System.Data.SQLite.EF6 (≥ 1.0.94.0)'.
Attempting to resolve dependency 'EntityFramework (≥ 6.1.1.0)'.
'System.Data.SQLite 1.0.94.1' already installed.
QLog already has a reference to 'System.Data.SQLite 1.0.94.1'.

PM> 

I added it to WXS:

(...)
<Component Id="System.Data.SQLite.dll" Guid="{BCA7E1B7-CA34-4B1C-829F-29D4F135912E}">
    <File Id="System.Data.SQLite.dll" Source="..\QLog\bin\x86\Release\System.Data.SQLite.dll" Vital="yes" KeyPath="yes" DiskId="1"/>
</Component>


<Directory Id='dir_x86' Name='x86'>
    <Component Id='x86' Guid='{C2869DAC-B3CC-4E87-AEF2-74F76025CFD9}'>
    <CreateFolder />
        <File Id='x86' Name='SQLite.Interop.dll' Source='..\QLog\packages\System.Data.SQLite.Core.1.0.94.0\build\net45\x86\SQLite.Interop.dll' />
    </Component>
</Directory>
<Directory Id='dir_x64' Name='x64'>
    <Component Id='x64' Guid='{452F3E46-B1E6-4A5A-B2CB-C7DA9B7EAB51}'>
    <CreateFolder />
    <File Id='x64' Name='SQLite.Interop.dll' Source='..\QLog\packages\System.Data.SQLite.Core.1.0.94.0\build\net45\x64\SQLite.Interop.dll' />
    </Component>
</Directory>
(...)

There are no "x64" and "x86" folders in Solution explorer as they are in tutorials but I can see system.data.sqlite under "references" (not enough reputation for images).

I even tried installing sqlite-netfx45 to deployment machine but it also doesn't help.

Any ideas? :-/

1
  • 1
    try highlighting the reference. Going to porperties and making sure that CopyLocal is set to true. Then make sure that the Sqlite Dll is copied accross to the live environment Commented Sep 24, 2014 at 13:03

2 Answers 2

1

I must note there are no "x86" and "x64" anymore in solution explorer :-/

an application deployment that looks something like this:

  • \App.exe (optional, managed-only application executable assembly)
  • \App.dll (optional, managed-only application library assembly)
  • \System.Data.SQLite.dll (required, managed-only core assembly)
  • \System.Data.SQLite.Linq.dll (optional, managed-only LINQ assembly)
  • \System.Data.SQLite.EF6.dll (optional, managed-only EF6 assembly)
  • \x86\SQLite.Interop.dll (required, x86 native interop assembly)
  • \x64\SQLite.Interop.dll (required, x64 native interop assembly)
Sign up to request clarification or add additional context in comments.

1 Comment

I removed autostart from installer and now the installer doesn't terminate. I can see file / folder structure after instalation and except "ProgramFilesFolder" (instead of REAL Program Files) it seems OK (check the picture), Interop files are present in x86 and x64 folders. It is present in services but it does not start (same reason as above). Pic: imgur.com/a/iAqBw . Any ideas why it does not work? :-$ And why doesn't "ProgramFilesFolder" keyword put it into Appropriate folder? :-/
0

I found the problem. The new version, doesn't need to specify the x86 target in build of the projects. Just select AnyCPU.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.