Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Distinguish config file
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Distinguish config file
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01177646
Message ID:
01177646
Vues:
42
Hi all,

I've build a component to log events in any application that uses it. I'm storing the event log name, source in the app.config. I read the configuration using ConfigurationManager.AppSetting["EventLog"] etc. Now I'd like to use the component in my web app too. In this case, I'd be reading the config from web.config using WebConfigurationManager.AppSetting["EventLog"] etc..

So my question is that how do I, in my component, identify which type of config file the application using then the component would load the settings from the correct file?
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Répondre
Fil
Voir

Click here to load this message in the networking platform