app.config

  • Thread starter Thread starter Alberto
  • Start date Start date
app.config is translated at build time to <yourappname>.exe.config and is
deposited alongside the built executable.

Anything you put in the appSettings section is automatically read at startup
and is available with ConfigurationSettings.AppSettings["keyName"]. In .NET
2.0 there is a ConfigurationManager class that works the same, and requires a
reference to System.Configuration.

Since this is an Xml document, you can read and write to it just as you
would with any other Xml document. In .NET 2.0 you have new classes that are
designed for this purpose. A quick check of the Framework documentation will
reveal all.
Peter
 
I'm working with VS2005 and using the System.Configuration but the
environment doesn't recognize the ConfigurationManager class.
I don't know why

Peter Bromberg said:
app.config is translated at build time to <yourappname>.exe.config and is
deposited alongside the built executable.

Anything you put in the appSettings section is automatically read at
startup
and is available with ConfigurationSettings.AppSettings["keyName"]. In
.NET
2.0 there is a ConfigurationManager class that works the same, and
requires a
reference to System.Configuration.

Since this is an Xml document, you can read and write to it just as you
would with any other Xml document. In .NET 2.0 you have new classes that
are
designed for this purpose. A quick check of the Framework documentation
will
reveal all.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




Alberto said:
How can I read and modify information in the xml file app.config?
Thank you very much.
 
you need to explicitly add a reference to "system.configuration.dll".

Gasnic
http://gasnicdev.blogspot.com

Alberto said:
I'm working with VS2005 and using the System.Configuration but the
environment doesn't recognize the ConfigurationManager class.
I don't know why

Peter Bromberg said:
app.config is translated at build time to <yourappname>.exe.config and is
deposited alongside the built executable.

Anything you put in the appSettings section is automatically read at
startup
and is available with ConfigurationSettings.AppSettings["keyName"]. In
.NET
2.0 there is a ConfigurationManager class that works the same, and
requires a
reference to System.Configuration.

Since this is an Xml document, you can read and write to it just as you
would with any other Xml document. In .NET 2.0 you have new classes that
are
designed for this purpose. A quick check of the Framework documentation
will
reveal all.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




Alberto said:
How can I read and modify information in the xml file app.config?
Thank you very much.
 
app.config is translated at build time to <yourappname>.exe.config and is
deposited alongside the built executable.

Is there any way to change this (Visual Studio 2003)? So that I could
have, debug.config and release.config and it chooses which one to copy
to appname.exe.config depending on which build is selected?
 
Back
Top