473,657 Members | 2,434 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

App.Config

Hi All,

I've wrote a windows service, and I'm trying to find a way to reload the
app.config <add> tags at runtime.

It looks like the dot net framework does not support it in any way.

Please replay if you know how can I do it.

Thanks

Bar

Jul 21 '05 #1
3 1413
I don't think you can do that. I believe the file is parsed when the app
domain first loads and it's never actually looked at again.

You could always use an INI file or a custom XML file with your settings and
load it whenever you want. App.config is bad in any case, especially for
applications that require per-user settings (as opposed to machine-specific
ones).
--
_______________ _____
Klaus H. Probst, MVP
http://www.vbbox.com/

"Bar Elimelech" <ba************ ****@hotmail.co m> wrote in message
news:%2******** *********@tk2ms ftngp13.phx.gbl ...
Hi All,

I've wrote a windows service, and I'm trying to find a way to reload the
app.config <add> tags at runtime.

It looks like the dot net framework does not support it in any way.

Please replay if you know how can I do it.

Thanks

Bar


Jul 21 '05 #2
Klaus,

Thanks for you fast replay, the thing is I'm not going to change the
app.config file very often, but my main problem is to change it on the
production server and I believe everybody have to do it sometime J.

Are you sure Microsoft did not come up with a solution to this problem, I’m
sure lots of developers faced this problem before I did and it should be
very common thing.

Thanks

Bar

"Klaus H. Probst" <us*******@vbbo x.com> wrote in message
news:#y******** *****@TK2MSFTNG P10.phx.gbl...
I don't think you can do that. I believe the file is parsed when the app
domain first loads and it's never actually looked at again.

You could always use an INI file or a custom XML file with your settings and load it whenever you want. App.config is bad in any case, especially for
applications that require per-user settings (as opposed to machine-specific ones).
--
_______________ _____
Klaus H. Probst, MVP
http://www.vbbox.com/

"Bar Elimelech" <ba************ ****@hotmail.co m> wrote in message
news:%2******** *********@tk2ms ftngp13.phx.gbl ...
Hi All,

I've wrote a windows service, and I'm trying to find a way to reload the
app.config <add> tags at runtime.

It looks like the dot net framework does not support it in any way.

Please replay if you know how can I do it.

Thanks

Bar



Jul 21 '05 #3
Well a Google search doesn't turn up anything interesting other than
recommendations to use something else or unload the application.
--
_______________ _____
Klaus H. Probst, MVP
http://www.vbbox.com/

"Bar Elimelech" <ba************ ****@hotmail.co m> wrote in message
news:un******** ********@tk2msf tngp13.phx.gbl. ..
Klaus,

Thanks for you fast replay, the thing is I'm not going to change the
app.config file very often, but my main problem is to change it on the
production server and I believe everybody have to do it sometime J.

Are you sure Microsoft did not come up with a solution to this problem, I'm sure lots of developers faced this problem before I did and it should be
very common thing.

Thanks

Bar

"Klaus H. Probst" <us*******@vbbo x.com> wrote in message
news:#y******** *****@TK2MSFTNG P10.phx.gbl...
I don't think you can do that. I believe the file is parsed when the app
domain first loads and it's never actually looked at again.

You could always use an INI file or a custom XML file with your settings

and
load it whenever you want. App.config is bad in any case, especially for
applications that require per-user settings (as opposed to

machine-specific
ones).
--
_______________ _____
Klaus H. Probst, MVP
http://www.vbbox.com/

"Bar Elimelech" <ba************ ****@hotmail.co m> wrote in message
news:%2******** *********@tk2ms ftngp13.phx.gbl ...
Hi All,

I've wrote a windows service, and I'm trying to find a way to reload the app.config <add> tags at runtime.

It looks like the dot net framework does not support it in any way.

Please replay if you know how can I do it.

Thanks

Bar




Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
3012
by: Maxim Khesin | last post by:
I want to have a config file with my python proggie, satisfying the following requirements: 1) support key->(value, default) 2) simple and intuitive to read and edit 3) easyly readable into a python datastructure (a dictionary?) 4) not requiring any heavy libraries needed (I am distributing my proggie as a py2exe executable and do not want to bloat the size) can you guys suggest some format for this? thanks, max
4
3821
by: Fuzzyman | last post by:
There have been a couple of config file 'systems' announced recently, that focus on building more powerful and complex configuration files. ConfigObj is a module to enable you to much more *simply* access config files. This is version 3, which is a big overhaul. It extends ConfigObj to reading config files with sections and various other simplifications. I find ConfigObj extremely easy to use and use it for reading config files and data...
3
3811
by: Richard Lewis Haggard | last post by:
I have a test application that is calling an assembly that reads some strings out of a config file. Normally, this assembly supports a web application and the information can be read just fine. Then I created a C# test application and ran the function. The function fails because the configuration read is failing to find a key. I created an application config and copied the keys over to the app config file but the app is still failing to...
13
507
by: Khodr | last post by:
Hello, I am using VS.NET 2003 and vb. I build my application MyApp and it generates MyApp.exe.config. So now MyApp.exe reads parameters from MyApp.exe.config. Great and no problem! I need to run the same program but with different configuration data. So I made a copy of MyApp.exe and MyApp.exe.config to put them in another folder and renamed the copy to MyApp2.exe and MyApp2.exe.config respectively. I ran it but it did not read from...
20
2607
by: tomerfiliba | last post by:
hey i've been seeing lots of config-file-readers for python. be it ConfigObj (http://www.voidspace.org.uk/python/configobj.html) or the like. seems like a trend to me. i came to this conclusion a long time ago: YOU DON'T NEED CONFIG FILES FOR PYTHON. why re-invent stuff and parse text by yourself, why the interpreter can do it for you? and anyway, i find this a very ugly format:...
11
3438
by: TARUN | last post by:
Hello All I need to ask about the configuration file in .NET, There are Two config File 1. Web Config 2. Machine config I understand the the usage of Web config , but not able to understand the usage of Machine config. I read in the article that you can also write your database connection string in Machine Config
12
13427
by: dbuchanan | last post by:
Hello, (Is this the proper newsgroup?) === Background === I am building a solution with two projects. One project is my data access layer which contains my DataSet as an xsd file. The XSD file was built by draging tables from the Data Sources pane. Auto-generated code created the files associated wtih the XSD file (xss,
5
7845
by: mmcd79 | last post by:
I built a VB.net application that makes use of a machine level DB connection string setting, and a user level starting location setting. The machine level setting and the default user based setting is of course stored in the app.exe.config file located in the same directory as the exe. Upon closing the form, I save the user setting which then creates a user.config file in the appdata directory in my profile. This is all well and good....
10
2047
by: eagle | last post by:
I have a web.config in my application that contains the connection strings to all my datasources. I want to move these connection strings to another web config up the folder hierarchy so that all my apps can use the same connection strings. That is supposed to be how it's done, no? Instead of the web.config being in c:\inetpub\wwwroot\myApp\web.config, I have it in c:\inetpub\wwwroot\web.config. However, I get an "Object reference not...
5
2854
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a app that uses several membership/role providers. I can list these Providers with the code: Dim rootWebConfig1 As Configuration rootWebConfig1 = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath) Dim section As New MembershipSection section = rootWebConfig1.GetSection("system.web/membership")
0
8395
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7330
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4306
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.