Solved

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

Posted on 2013-11-29
3
276 Views
Last Modified: 2014-04-03
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
Comment
Question by:aatjan
3 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 39801792
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question