Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Distinguish config file
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
Distinguish config file
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01177646
Message ID:
01177646
Views:
41
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

Reply
Map
View

Click here to load this message in the networking platform