how to deploy sqlite with .Net

2019-02-27 00:49发布

I got a report from a user that when they installed my .net 2.0 app they got a message that a reference to system.data.sqlite.dll could not be found. I use Inno to install it in the same folder as the executable and no problems from others. Does it make any difference what the copy local property is when I add the reference in VS? my understanding is that only impacts running it under VS. As long as the user has sqlite in the same folder as the executable, shouldnt that be all that is needed? could there be a permission or other secutity issue that blocks installing the dll? does sqlite.dll need to be registered? -no one else has had to.

标签: c# .net sqlite dll
2条回答
SAY GOODBYE
2楼-- · 2019-02-27 01:10

Yes, if it is in the folder with the executable, it works. But you will have to deal with 32 bit an 64 bit architectures, there are seperate assemblies for that. 32 bit is in /System.Data.Sqlite.dll, 64 bit in /x64/System.Data.Sqlite.dll.

查看更多
手持菜刀,她持情操
3楼-- · 2019-02-27 01:16

As has been pointed out this is probably an architecture problem. We are in fact having the same issue with Oracle.

You have ? solutions:

  1. Create two installers one x86 and one x64 that use the appropriate sql lite dll.
  2. Create an intelligent installer that copies the appropriate dll into the bin folder.
  3. Install the relevant sql lite into the gac. You may need to create the installer for this and you would probably want to set it up as a prerequisite for your application.

If you are not tied to SqlLite you might want to take a look at SqlCe. The installers are already there and available as prerequisite in visual studio and chances are they it is probably already installed on some client machines.

查看更多
登录 后发表回答