ClickOnce

For my application I use an access database and ClickOnce for installation. When I run the application after installing everything works just fine. however, if I change something and run setup to update to the latest build the changes to the access file are gone. I figured this was because ClickOnce will install updates to new directories so I decided to move the access database to an outside directory. I figured ClickOnce would not be able to touch a directory it was not installing to. well, I updated and again the access database gets wiped. Evedentally MS has made ClickOnce very smart. I think this is great since it helps to insure dependancy files are cleaned up when uninstalling an application but it sure kills things when doing simple updates. is there anyway of telling clickonce not to remove the access file when updating to newer builds any other suggestions for workarounds if not using a database server is not an option for this project.

Thanks for any and all help.



Answer this question

ClickOnce

  • DavidC#2005

    Actually SQL Express (depending on how you use it) would have the same problem.

    Each version of a ClickOnce app gets its own set of folders created by the runtime. When the app gets updated, a new set of folders are created for the new version. Data files will only get copied over to the new version on the client side if they were identified as data files (through the Application Files... button in Publish property settings).

    So the question is whether you have marked the files that are being edited as data files If they are local files that are being created dynamically, you need to put them in the application data folder so that they will migrate to new versions.



  • SwissToni

    For this type of project an SQL server (like SQLExpress) cannot be used for the following reasons.

    1. it's overkill. The program is used by only 1 person and, the resources needed for the SQL are higher then what it is worth

    2. At most this project will have 30 records. again, it would be over kill to run a database server for something that at most would be 30 records.

    3. Most of the systems it will run on are either not equiped/capable of running SQL Express and/or SQL Express would cause issues else where.

    there are other reasons which I do not wish to go into (rather lenthy list) but I need a workaround or alternative. trust me, SQL Express has passed my mind a few times.

    Thank for the reply. any other suggestions


  • sunnydhiman

    Why don't you use SqlExpress2005

  • daking

    I was able to workaround this by coding a manager at the application start to pull the access file from the older version of the program.
  • ClickOnce