Solved

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

Posted on 2013-11-29
3
275 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Encryption Decryption in Oracle 12 59
.NET Error 7 42
Code enhancement 5 12
How to open a link from vb.net app 3 9
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now