[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 291
  • Last Modified:

how to include datafiles in a bin directory with a clickonce deployment (vb.net)

hi, my application, build with vb. net, assumes that some 'datafiles' are available in the bin directory.

I'm using a clickonce deployment. Can't get it working: when starting the app it complains that it cannot load that datafile.

I changed the file properties of that file (build action "content", copy; always) but it still does not work.
Does anyone has a suggestion?

thanks.
0
aatjan
Asked:
aatjan
1 Solution
 
Jacques Bourgeois (James Burger)Commented:
In the Publish tab, when you prepare your deployment, click on Application files, activate Show All Files at the lower left bottom, and make sure that your file is marked with Include.

Note that  in .NET, unless you run the application as an administrator, files distributed in the same directory as the application are usually readonly. This is true whether you deploy with ClickOnce or through a more standard .msi deployment in Program Files.

Files that need to be modified by the user should be installed in another directory. This is easy to do with a standard setup, because you can specify the location of the files, but not so with ClickOnce, where you have absolutely no control over the location of the files.

What I do in such situations is to copy the files that need to be edited from the installation directory to either MyDocuments or the user's Application Data directory. This is naturally done only when the application starts for the first time. Afterward, it checks for the presence of the copied files and does not copy them if they are already in the correct location.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now