Accessing configuration files from class library classes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This has been bothering me for awhile now and I need to ask the question.
There are classes in the BCL and in third party apps that access the
configuration file programmatically. Let me use the new WCF class
ServiceHost as an example. The service host class can be completely setup
programmatically or it can be setup declaratively through the configuration
file. So my question is how do they program it to read the configuration
when that configuration could be in a Web.config or an app.config. Do they
just always use the ConfigurationManager class to access the config file?

Thanks
 
Hello, Oldman!

There is nice set of articles about configuration files in .NET 2.0

http://www.codeproject.com/dotnet/mysteriesofconfiguration.asp
http://www.codeproject.com/dotnet/mysteriesofconfiguration2.asp
http://www.codeproject.com/dotnet/mysteriesofconfiguration3.asp

--
With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com

You wrote on Tue, 11 Sep 2007 12:50:01 -0700:

O> This has been bothering me for awhile now and I need to ask the
O> question.
O> There are classes in the BCL and in third party apps that access the
O> configuration file programmatically. Let me use the new WCF class
O> ServiceHost as an example. The service host class can be completely
O> setup programmatically or it can be setup declaratively through the
O> configuration file. So my question is how do they program it to
O> read the configuration when that configuration could be in a
O> Web.config or an app.config. Do they just always use the
O> ConfigurationManager class to access the config file?

O> Thanks
 
Back
Top