user1261648
user1261648

Reputation: 25

How to get SQLite database file working as embedded resource with C# published project

I've searched extensively and I followed loads of advice (pretty much all saying the same thing) with regards to this problem, but it still won't work.

I'm building a C# graphing application using Zedgraph, and using an SQLite database. I was still tweaking the DB until recently but now it's correct and I want to add it as a resource to my project, so that when I publish my Project, it's be part of the setup and will work with my application. I've added the resource the way one usually does it, and it's in my resources folder in the project. I have it set to Copy Always and it's as an embedded resource. I'm not sure if this is correct though. My application builds and runs fine from VS. But when I publish, it can't find my tables as the DB file is obviously missing.

How can I get the DB file working with the application so that I can distribute my app?

Thanks.

Upvotes: 1

Views: 2518

Answers (1)

Abhinav
Abhinav

Reputation: 2085

Are you using a Visual Studio Installer Project? If yes, it might be that the file is not being included in the installer file. You can force-add it from the Dependencies in that project.

Check this one out for adding external files.

Upvotes: 1

Related Questions