tags:

views:

562

answers:

2

I've got an application that I'm moving over to ClickOnce and the app has a moderately sized data folder with hundreds of files that I need to inlcude in the deployment. The folder needs to be in the same place relative to the EXE after deployment. I've seen several suggestions on how to do this but there doesn't seem to be a agreed upon method for doing this.

Any suggestions would be great -

Thanks!

A: 

After deployment, all files marked as data are placed in the ApplicationDeployment.DataDirectory folder. I know of no way to change this. You could copy the data files during the first run of your app, but this approach will not survive any upgrades that include data file changes.

Alternatively if you have control over the location of the data folder during development, you can place in the same relative (to the app folder) location as will be specified after deployment.

RoadWarrior
+1  A: 

Hi!

One good way of doing this is:

  • Create a folder under the app in VS name e.g. "datafiles"
  • Add all files to that folder using Add as link in the dialog box after selecting Add existing item on the folder
  • Mark all files as Copy if newer (Copy to output directory property)
  • Make sure the build action is content

--> when you publish the files will be put in that folder and be a part of the application installation

Good luck!

andyhammar