Solved

Best way to store configuration details?

Posted on 2008-11-03
7
906 Views
Last Modified: 2013-12-17
So I have a windows application (C# .NET VS2008) where i put my configuration values into Settings like so...(Solution's View -> Your Project name -> Properties -> settings.Settings - which seemed like the right thing to do.  But, what i was really looking for was a way to change application settings easily without needing to recompile and without having to put controls in to the application itself to allows them to be changed (the program runs silently and so putting controls in to allow changes to config values via the application itself is not really practical).  I was expecting to see something like a app.config file (like i see when i develop a web service) get written to the installation directory of the application after i install it (or perhaps it is there - but i just don't know where to look?)
0
Comment
Question by:kurb
[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
  • 2
  • 2
  • +1
7 Comments
 
LVL 4

Expert Comment

by:Makolyte
ID: 22868027
This article explains how to write/read to the app.config file: http://geekswithblogs.net/akraus1/articles/64871.aspx
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 22868095
0
 

Author Comment

by:kurb
ID: 22868873
Ok, so based on those articles, it sounds like i can not actually edit a config file outside of the application to change config values.  My options would be...  1. open the project, change the "settings" and rebuild.  2. provide a form in the application to allow a user to change these values.   Please correct me if i am wrong.  What i really want to know is, how do i change application config values OUTSIDE of the application (meaning without having to build it again and without having to provide an interface of some kind).  If there is a file i can edit - if so - where is it?  I see config files all over the place - which one will actually affect these values at run time?  (Sorry newbie here - you have talk slow an simple for me)
0
Increase Agility with Enabled Toolchains

Connect your existing build, deployment, management, monitoring, and collaboration platforms. From Puppet to Chef, HipChat to Slack, ServiceNow to JIRA, Splunk to New Relic and beyond, hand off data between systems to engage the right people.

Connect with xMatters.

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 22869217
yes you can edit the values in those files. it is a XML file so open it with Notepad and do it.
0
 
LVL 26

Accepted Solution

by:
Anurag Thakur earned 100 total points
ID: 22869416
when you add settings in your file and then build and deploy your application and applicationname.exe.config file is also installed the bin folder
all your settings are part of that file and if you need to modify some setting then open the file in some editor and update the setting
you dont need to build the setup and deploy it agian if some setting changes
0
 

Author Comment

by:kurb
ID: 22869974
I figured out what was happening (now remember i said i was a newbie).  I was publishing my  application and then installing it from the setup.exe created.  This did some magical stuff that didn't produce what i had expected (which was a app.exe and an app..exe.config file).  Instead it produced some manifest files an d a file called app.exe.config.deploy.  So a friend told me to build a new "set up wizard" project and add it to my solution.  Doing this produced an msi installer, but this time, when i installed it, it made a app.exe and an app.exe.config file.  I could then opent the config xml and edit it directly as i wanted to.  I think the setup.exe created by the "publish" action is just doing some magic that i don't understand - i could not locate the config file after installing this way.
0
 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 22873473
i hope it worked for you and if still not then let us know
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

719 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