Where are you publishing it to? And what to you mean, it "deletes" your
directory and file? You mean the installed one on the client, or the update
that you have put somewhere? Are you hosting it through a webserver?
ClickOnce does not install to ProgramFiles. It installs under the user's
profile, and obfuscates the folders so it's not obvious where it is. When
you perform an update, it creates another set of folders, and does not copy
anything over from the old folders to the new.
If you mean that it deletes a data file, you need to put the data file
somewhere other than startuppath. Try LocalApplication; in C# it's
Environment.SpecialFolder.LocalApplicationData. This will probably work in
VB, or there's a MY version of it. This is where Microsoft recommends you
put data files; they go under the user's directory. If you were installing
your stuff to Program Files, the user would have to have a higher access
level to change files under Program Files. On XP, the above path goes to
C:\Documents and Settings\username\Local Settings\Application Data\. I
usually concatenate it with my application name and create my own folder
for config settings and other data I want to persist when I do updates.
(Ignore SusieDBA -- he's a troll, and does not work for MSFT).
Robin S.