1

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.

7
  • Do you see the file being published and in correct folder? Commented Feb 12, 2014 at 20:45
  • Hi, I've never had to do this before so I'm not sure what you mean by seeing the file being published? I just follow the wizard and then it takes me to the folder with the setup file - I don't see anything happening. Sorry about the noob-ness. Everything I've worked on so far either hasn't had a DB or is part of a way bigger project that has it's own build scripts so I never have to worry about these things! Commented Feb 12, 2014 at 20:49
  • 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. Commented Feb 12, 2014 at 21:01
  • Check this one out for adding external files: stackoverflow.com/questions/6907536/… Commented Feb 12, 2014 at 21:03
  • That helped me a long way. I needed to change the build action to content, and then I could see it in the application files tab in publish (which I couldn't when I had set as an embedded resource) and then I set the publish status to include, and it worked! Thanks for your help! Commented Feb 12, 2014 at 22:03

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

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.