3

Have a smartclient application that is distributed using Click-Once, but also includes a SQLite DB for a local cache.

The problems is that once the app is published it doesn't seem to be able to open the SQLite DB file. Have included the DB file as part of the install process...

Any thoughts?

5
  • Do you get an exception? Commented Sep 2, 2009 at 13:34
  • System.Data.SQLite.SQLiteException: Unable to open the database file Commented Sep 2, 2009 at 14:00
  • 1
    Is your deployment requesting "full trust"? Commented Sep 2, 2009 at 14:17
  • How do i setup the "full trust" thingy? Commented Sep 2, 2009 at 14:35
  • How are you creating your deployments? Visual Studio? If so, what version 2005, 2008? Commented Sep 2, 2009 at 15:05

4 Answers 4

3

When a ClickOnce application is set to "Full Trust", on install it will prompt the user to grant full trust. This means that the application will have all the same privileges on the computer as the user running the application (editing the regisitry, file io, etc). You mentioned in the comments that the app is set to full trust, so it would appear that it's not a security issue.

Are you certain all of the necessary files are getting deployed? I would just remove ClickOnce from the picture. Look at all the files in your deployment, create a folder and copy all those files into it, then try to run it. Does it work? My initial guess is that some needed file is not being included in the ClickOnce deployment.

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

Comments

1

Check the path that your app is using to get to the database. Virtuallized paths can cause these sorts of problems on Vista and above.

Then check the read/write permissions on the database file.

Comments

0

Have you included the SQLite provider in the package?

1 Comment

Yes, its just not able to open the db file. Works fine when debugging, which makes me thing it might be a security thing?
0

I had a same problem. My solution was to add SQL.interop.DLL (x32 and x64) in the Visual Studio Project (as link) so that the ClickOne Deploiment add those files in this "package" Look this blog post : http://webbercross.azurewebsites.net/ef7-sqlite-click-once-deployment-error/

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.