My clickonce App has an .ini file(config from a 3 party dll) that must be included on app root directory.
I added the file as link and mark as "content" and "copy if newer".
The problem is that every time that I deploy an update, clickonce download the file again overwriting all changes.
Why clickonce is not respecting "copy if newer
" ?
Why clickonce is not respecting "copy if newer" ?
Because that's used by the compiler when copying to the bin (or where ever the binaries are compiled to). This setting has nothing to do with clickonce.
I would recommend renaming your INI to "base.ini", or some equivalent. When your application starts, copy it to a new file with the new name if, and only if, it doesn't exist already. Something like this:
if (!File.Exists("yourinifile.ini"))
{
File.Copy("base.ini", "yourinifile.ini");
}
EDIT:
You may be able to mark your file as a data file in your ClickOnce manifest. To do this,
- Open the properties of your project
- Select the "Publish" tab
- Click the "Application Files..." button
- Find your INI file in the list of files, and change the Publish Status to "Data File".