By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,337 Members | 2,234 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,337 IT Pros & Developers. It's quick & easy.

Application Configuration File?

P: n/a
What Application Configuration File is? And
when/where/how to use it? Any documents on that? MSDN has
somrthings scatter everywhere - hard to follow.

thanks,

Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Kathy,
An Application Configuration File is an XML file that .NET uses to configure
your application.

For ASP.NET applications the file is called web.config. At run time it is
still called web.config.

For Windows applications, the file is called app.config. At run time the
app.config is called myexe.exe.config and need to be in the same directory
as the exe itself.

Class libraries (.dll files) do not have an Application Configuration File,
they need to rely on either the web.config or the app.config.

When you use 'Project - Add New Item - Application Configuration File' in
VS.NET to add one to your project it will be named either app.config or
web.config per above. At runtime it will be moved to the appropriate folder
and used.

There is also a machine.config file, that .NET uses to configure your
application. This file is merged with the app.config with the app.config
getting precedence. In other words you can use the machine.config to have
global settings that are shared across apps, then use the app.config to
override some of these settings.

The two primary sections of the app.config are configSections and
appSettings. appSettings is a predefined section that allows you to define
name/value pairs. You use
System.Configuration.ConfigurationSettings.AppSett ings to read values from
the appSettings section.

configSections allows you to define your own sections. You use
System.Configuration.ConfigurationSettings.GetConf ig to retrieve these
values.

See the following for create new sections via the configSections section.

http://msdn.microsoft.com/library/de...onhandlers.asp

and:
http://msdn.microsoft.com/library/de...ionsschema.asp

Also read about the System.Configuration.ConfigurationSettings class and
other classes in the System.Configuration namespace.

And yes, the documentation is scattered & hard to follow...

Hope this helps
Jay

"kathy" <ka***@nospam.com> wrote in message
news:00****************************@phx.gbl...
What Application Configuration File is? And
when/where/how to use it? Any documents on that? MSDN has
somrthings scatter everywhere - hard to follow.

thanks,

Jul 19 '05 #2

P: n/a
The intent was not to offend you which you seem to have been so my
apologies.

Good luck in your search and hope Jay's answer following mine is more
helpful.

Peace.

"kathy" <ka***@nospam.com> wrote in message
news:03****************************@phx.gbl...
"specific technical questions" means what? My question IS
a specific technical questions.

your answer is useless.

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.