app.config

A

Alberto

How can I read and modify information in the xml file app.config?
Thank you very much.
 
G

Guest

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
 
A

Alberto

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.
 
G

Gnic

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.
 
C

Chris Chilvers

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top