473,406 Members | 2,705 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,406 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 2779
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.