?
Solved

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

Posted on 2013-11-29
3
Medium Priority
?
282 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses

771 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