System.Configuration

  • Thread starter Thread starter Joe Reiss
  • Start date Start date
J

Joe Reiss

Using vs2005, C#

I'm writing some code to settings out of my app.config file. I seemed to be
missing many fields from System.Configuration. For example
System.Configuration.Configuration will not compile. Why am I missing so
many methods from this namespace?

Thanks,
Joe
 
Joe Reiss said:
Using vs2005, C#

I'm writing some code to settings out of my app.config file. I seemed to
be missing many fields from System.Configuration. For example
System.Configuration.Configuration will not compile. Why am I missing so
many methods from this namespace?

Thanks,
Joe

Try System.Configuration.ConfigurationSettings.AppSettings for appSettings
element data retrieval :)

(this is the property of the ConfigurationSettings class in .Net 2003...I'm
unsure if it's changed in 2005.)


HTH,
Mythran
 
Hey,

If you look at MSDN help on the class you are missing, you can see what
assembly it belongs to. No doubt you are missing a reference to the
correct DLL.
I believe that some of the System.Configuration classes are actually
in:
System.Configuration.DLL
.... which is not always referenced in all project types. Check you have
that reference, and try your intellisense again.

Also, check out ConfigurationManager. Its funky. Lots of examples on
MSDN.
 
If I want to pull out from <connectionSrings> how do i do that? The above
just gives from <appSettings>.

Thanx,Joe
 
How do you pull out from <connectStrings> section? The above just does
<appSettings>.

thnx,
joe
 
Back
Top