473,322 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

AppSettings

Hello everybody!

Ma question est simple :
Est il possible de supprimer la section appSettings en memoire pour se baser
de nouveau sur le fichier de config.

Resumé bref de ce que je veux faire :
Lors du premier acces a la section appsettings, .NET construit en memoire
une collection Key - Value en lecture seule.
Normalement, pendant toute l'execution de l'appli, cette derniere utilise la
collection en memoire....
Mon but est, a un certain moment dans le code, d'oublier la collection en
memoire et de repartir sur des bases neuves.....
Ca a l'air bizarre comme ca, mais, ma section AppSettings est modifiée, elle
n'est plus aussi basique que celle par defaut!!!

Les pistes :
- system.configuration.configurationsettings.appsett ings.clear ne fonctionne
pas car la collection est READONLY
- ou alors, comment relancer le chargement en memoire? (interface
IConfigurationSectionHandler)
merci pour vos reponses!!!!!!!

a+
syl

Nov 22 '05 #1
2 2770
Excuse me!!!!
Here is the english version of my problem :

the question is simple:
How to delete the appsettings section in memory in order to re-use the
configuration file?????

I know that for the first access in the appSettings, .NET build in memory un
readonly Key - Value collection.
I just want to delete this collection... and rebuild it in order to use the
new paraemters in the configuration file.
Thanks for everything!

Bye!
Syl
Nov 22 '05 #2
Bonjour Lobrys,

Les sections dans le fichier de configuration sont malheureusement mises
dans un cache en interne, et il n'y a aucun moyen de les rafraîchir comme tu
as pu t'en apercevoir.

Le seul moyen que je vois (pour rafraîchir) et l'utilisation d'un AppDomain,
qui expose les données du fichier de configuration et de décharger et
recharger cet appDomain à la demande. C'est pas super « propre », mais dans
la version future du fx il y aura une solution à ce prob lème.

A+

Eric Vernié

Microsoft

PS :

Une autre méthode serait de créer ta propre classe de lecture de fichier de
configuration.


"lobrys" <PU************@SPAMfreeDE.MERDE.fr> a écrit dans le message de
news:OP**************@tk2msftngp13.phx.gbl...
Hello everybody!

Ma question est simple :
Est il possible de supprimer la section appSettings en memoire pour se baser de nouveau sur le fichier de config.

Resumé bref de ce que je veux faire :
Lors du premier acces a la section appsettings, .NET construit en memoire
une collection Key - Value en lecture seule.
Normalement, pendant toute l'execution de l'appli, cette derniere utilise la collection en memoire....
Mon but est, a un certain moment dans le code, d'oublier la collection en
memoire et de repartir sur des bases neuves.....
Ca a l'air bizarre comme ca, mais, ma section AppSettings est modifiée, elle n'est plus aussi basique que celle par defaut!!!

Les pistes :
- system.configuration.configurationsettings.appsett ings.clear ne fonctionne pas car la collection est READONLY
- ou alors, comment relancer le chargement en memoire? (interface
IConfigurationSectionHandler)
merci pour vos reponses!!!!!!!

a+
syl


Nov 22 '05 #3

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

Similar topics

2
by: hazz | last post by:
I have spent more time than I care to admit trying to track down a very subtle error. Here is my app's xx.exe.config file. <?xml version="1.0" encoding="utf-8" ?> <configuration>...
2
by: Kenneth | last post by:
Hi, In web.config I have an appsettings: <appSettings> <add key="constring" value="Server=localhost;UID=sa;PWD=secret;Database=myDB" /> </appSettings> This is for my developing machine.
5
by: Eric Sabine | last post by:
the second I add <appSettings> </appSettings> to my web.config file (just after the <system.web>), my web application will no longer run. I get an error that reads: Error while tyring...
2
by: Fuehner | last post by:
Everyone-- I installed the .NET 2.0 framework on a server that also has version 1.1 installed. A few of my applications override the "appSettings" section in the web.config with a custom config...
4
by: Jim in Arizona | last post by:
I've been using VB 2005 for a few years now. My entire coding history is VB related. This weekend I decided to start learning C#. I'm at work now and decided to do some coding in C# that I would...
7
by: moondaddy | last post by:
I'm running a wpf windows app and want to add the appSettings element to the config file. when I do, the app wont start up and I get the following error: {"The type initializer for...
1
by: sandy.82in | last post by:
Hi I'm new to C# , I'm using VS2005 and .NET2.0 .Here is my issue i just developed a simple application with app.config , and a simple class library and following is my app.configfile <?xml...
1
by: Ken | last post by:
I'm currently using 1.1. Is there any way using the value of a ConfigurationSettings.AppSettings as a key of ConfigurationSettings.AppSettings.Tosting( )]? for example in web.config <add...
5
by: Osamede Zhang | last post by:
I just can't understand what appSettings means, how it work thanks for your read osamede
3
by: Junior | last post by:
Vista SP1 IIS7 I'm trying to configure web.config following MSDN docs but keep getting errors I don't know how to resolve.. <configuration> <!--error--> <appSettings...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.