?
Solved

Configuration File

Posted on 2004-08-17
3
Medium Priority
?
223 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
[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
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
jzwaenepoel earned 375 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month13 days, 14 hours left to enroll

800 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