Editing a Config file

Posted on 2011-10-14
Last Modified: 2012-05-12
I created a app using Visual Studio 2008. I've been programming in VB for years and thought that I would try my hand at a simple application to sort some of the archived emails on our server.

I created the application with a config file with the thought that I would then be able to use the application on serveral different servers that store the archived files in different locations without having to recompile the program for each server.

When I publish the application it makes a setup.exe which is foreign to me. I guess that Microsoft eliminated standard MSI packages and now has a "click once" installer package. Well now that I'm done giving you some history on my situation here is my problem.

When I install the app on the server it puts the files in the frustratingly buried location of "C:\Documents and Settings\admin\Local Settings\Apps\2.0\2H69XTWK.OHX\QW0E6L41.5N1\dele..tion_4ebea5cbbf70dc46_0001.0000_9b33683a71325b11". If there is a way to change the install location please let me know.

 I found the config file and the executable and the config file in the same folder:
When I try and edit the config file to point the application to correct path for the archived files it still uses the old path that it was originally compiled with. Am I editing the wrong file?
Question by:David11011
    LVL 40

    Accepted Solution

    You edit the config file throught the My.Settings object, not by writing directly in it.

    Is you want to install in another directory, do not use ClickOnce. ClickOnce has been designed so that the application update itself automatically, but you lose the hability of defining where it installs.

    To create a standard .msi installation, File...Add...New Project...Other Project Types...Setup and Deployment...Visual Studio Installer and go from there.
    LVL 2

    Author Closing Comment

    Thanks for this info on MSI installer.

    I discovered that I am able to edit the configuration file with a text editor after the application is compiled and installed.

    The problem with my application was that I created the config file as an after thought after I already completed the app and when I was pointing my variables to the config file I missed one and it's value was still set within the vb code. The application's ability to load is dependent upon this variable so all I saw was an error upon loading the program and assumed that the values in the app were not changing when I modified the config file.

    It was more of an ID10T error than anything.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Normally a window is moved by clicking on the caption bar and dragging. You may want your user to be able to move borderless forms or move a form by clicking anywhere in the form without the limitation to the caption bar. There are many ways to do i…
    It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    761 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

    8 Experts available now in Live!

    Get 1:1 Help Now