Customizing ClickOnce Application Settings

I am currently developing a ClickOnce application that converts CSV files to update the database. The program requires the user to be able to modify the configuration files to modify the database and modify the XML file that populates the dropdown in the application.

Now I understand that the files are stored in the user / appdata folder to ensure they have the correct privileges, but can I have any influence on what these folders are called or where are they stored?

By default, files are saved in AppData\Local\Apps\2.0\LD7ZEJK0.7AE\NJ42PEPW.1QX\csvt...exe_169e1a4011fbe7ec_0001.0000_none_04507fe9e077ae84

Can I change this to say Documents\CSV_Files

or something similar? And if so, how can I refer to the XML file in the config file so that the program knows where it is?

+1


source to share


2 answers


You usually don't need to take care of the location yourself. Just mark your XML file as data in the ClickOnce manifest and access it using the known ones:

ApplicationDeployment.CurrentDeployment.DataDirectory

      



This is the MSDN article: Accessing Local and Remote Data in ClickOnce Applications

+2


source


I will never store any data that is important to keep in the event of an update in the real ClickOnce deployment directories - this is too dangerous. You must copy these files to ApplicationData and access them. This article shows you how to do this.



0


source







All Articles