[英]How do I include my SQLite database in my published vb.net project?
I have been working on a project in vb.net which uses an SQLite database (Patient_Database.db). 我一直在vb.net中使用SQLite数据库(Patient_Database.db)的项目中工作。 The connection between the software and the database works when I debug the program, and the database is stored in the project folder, and automatically transferred to the debug folder, as shown:
当我调试程序时,软件和数据库之间的连接有效,并且数据库存储在项目文件夹中,并自动传输到调试文件夹,如下所示:
However, when I publish the project in order to make an executable, the database is not included in the publication. 但是,当我发布项目以使其成为可执行文件时,数据库不包含在发布中。 I have spent all day trying various walkthroughs online but I just don't seem to be able to get the publication to include the database or the necessary SQLite.Interop.dll file in the x64 and x86 folders in the Debug folder.
我已经花了一整天的时间在线尝试各种演练,但是似乎无法使出版物在Debug文件夹的x64和x86文件夹中包含数据库或必要的SQLite.Interop.dll文件。
My published project looks like this: 我发布的项目如下所示:
With the following inside the Application Files folder: 在“应用程序文件”文件夹中包含以下内容:
I realise that I might be doing something stupid, or that I might just be going about this in the entirely incorrect way. 我意识到我可能正在做一些愚蠢的事情,或者我可能只是以完全错误的方式来做这件事。 If anyone could correct my flawed methods that would be very helpful!
如果有人可以纠正我有缺陷的方法,那将非常有帮助!
Thanks 谢谢
In regards to the comments some visual help for you: 关于评论,为您提供一些视觉帮助:
Publish
tab Publish
选项卡 Application files...
Application files...
Show all files
first Show all files
先Show all files
Include
Include
Required
. Required
。 After a new publish the DB file should be contained in the Application Files
on your server. 新发布后,数据库文件应包含在服务器上的
Application Files
。
EDIT: To make the file visible for the published application files you have to set its 'Build Action': 编辑:要使文件对于已发布的应用程序文件可见,您必须设置其“生成操作”:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.