Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ClickOnce Deployment placing an .ini in the %APPDATA% directory

Posted on 2013-01-23
2
Medium Priority
?
795 Views
Last Modified: 2013-02-13
I have a vb.net desktop application that is deployed with clickonce.   I have recently added an ini file to for some generic info that I need to read during various times.   How do I have the 'ini' file automatically placed in the appdata folder at installation.

I have looked in the Publish Properties and do see where.

Thanks.
0
Comment
Question by:browe68
2 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 2000 total points
ID: 38812045
You should you .config files instead of .ini files. They have a lot of advantages over .ini files.

1. They are the standard way of working with such files in .NET.

2. They are also used by some features of the framework, so you might need one anyway. Having to deploy one file instead of 2 makes things easier, specially since they are automatically included in a ClickOnce application.

3. They can be created and managed easily through the Settings tab of the Project's Properties window.

4. They are typed, so you cannot, for instance, enter an invalid date in a date setting.

5. When a setting is defined as a User settings, the framework automatically takes care of moving it to the AppData folder.

6. The framework also takes care of keeping separate setting values for each user when many users use the same computer.

7. Many users will shy away from the XML files that contains the settings, so there is less risk that someone go in there and type an invalid value.

8. There are mechanisms built into the framework that enable you to easily change the value of a setting if you need to do so while updating the application.

You can learn more at http://msdn.microsoft.com/en-us/library/a65txexh(v=vs.100).aspx
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38812233
You can click on Application Files button on Publish tab and select Include against that file. App.config is preferred approach though.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

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…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Integration Management Part 2
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

885 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