Link to home
Start Free TrialLog in
Avatar of Kaprice
KapriceFlag for United States of America

asked on

OneClick publish - Any way to NOT update the MDF?

I have an app that uses OneClick to publish it. This is important so that updates auto install.

BUT, I don't want to overwrite the client's database (MDF) with the update.

How do I do that?
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Kaprice

ASKER

So, is the answer that there's no built-in way to avoid including a file (such as the data file) in a OneClick update?

If so, that link looks like a very good work around. I assume I run that code on startup -- prior  to loading my main form? And then I'd need to change my connection string to point to the new client folder, right?
There is a way to exclude files from ClickOnce deployment but there is no way to distinguish between first install and upgrade as far as I know. So you either exclude file from both first install and updates or you include it for both first install and update.

Yes the code will need to run at start and then you can update your connection string (which you can keep in your *.settings file).