开发者

ClickOnce deletes my local database when it updates.. how not to?

开发者 https://www.devze.com 2022-12-10 14:20 出处:网络
I\'m using ClickOnce to deploy my application. When the ap开发者_运维百科p runs the first time, if a db doesn\'t exist, it creates one.

I'm using ClickOnce to deploy my application. When the ap开发者_运维百科p runs the first time, if a db doesn't exist, it creates one.

Problem is, when I update, it removes the local database. Is there a way to tell it to ignore it?


I imagine you're putting it in the applications directory... don't!

Put it in Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData or Environment.SpecialFolder.LocalApplicationData).


Don't include the database in the deployment. Implement your own db creation (using script) when the database isn't present.


In the project's Publish options, under Application Files, is the database file's Publish status set to Data File?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号