Solved

Configuration File

Posted on 2004-08-17
3
219 Views
Last Modified: 2010-04-23
VB.NET + SQL SERVER 2000

I am about to start work on an application that maybe deployed in a terminal services environment. Currently I use the registry to store the settings for each system user. I have read a few books on .NET that seem to steer away from the registry. The one problem I can see with a configuration file is that all the users settings are grouped together in a single file, this may be a good thing. I guess what I am asking is, is it down to personal preference or is there a documented right way and wrong way. Also I normally store the SQL Server name and login details in the same area, is this standard practice?

0
Comment
Question by:rocky050371
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
jzwaenepoel earned 125 total points
ID: 11819461
Actually,

The configuration file is good place to store read-only settings, so it is not the correct place to store user-configurable settings.

The config-file can be used for setiings that are not to be modified by the end-user, but maybe by an administrator.  For example a database connection string (watch out with passwords) or trace-level-settings, etcetera.

User configurable settings should be stored in a file in the Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) folder or a subfolder.
I usually use an INI-file or an XML-file for these settings

Hope this helps,

Joris

0
 

Author Comment

by:rocky050371
ID: 11819544
Thank you, that does help. I take it you install the config file to the app path. Also I seem to remember that there is a built in configuration file utility, but can't think where. Any ideas?
0
 
LVL 1

Expert Comment

by:jzwaenepoel
ID: 11819656
Thanks,

The config file goes in the app path (and has the same name as the exe-file with ".config" appended).

I do not know about a built-in configuration file utility.

All I know is that if you add an app.config file to your project, then it is copied to the the bin-folder with every build and gets its correct name automatically.  You have to edit the XML file manually.  In the IDE, you can open the config-file and then click select "XML" or "Data" (left-lower corner of the screen).  Maybe the "data"-view is what you remember as the built-in configuration utility?  

Joris
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

840 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