• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 247
  • Last Modified:

Editing a VB.net Config file

I created a VB.net app using Visual Studio 2008. I've been programming in VB asp.net 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?
1 Solution
Jacques Bourgeois (James Burger)PresidentCommented:
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.
David11011Author Commented:
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.

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now