views:

284

answers:

4

In WCF services and a variety of other .NET apps, I understand that app.config is used to specify settings. Is this file only used at compile time and settings get stored in the assembly or is it required at run time as well? Does it vary per project type?

+3  A: 

It's a run time thing. There are a bunch of APIs in the System.Configuration namespace that can be used to read settings from application configuration file (Web.config in Web apps, assembly.exe.config in others.)

Mehrdad Afshari
+1  A: 

If you are using app.config to supply configuration paramters to the application, then it will be needed at runtime.

Sam
+2  A: 

The app.config is the .NET replacement for the old school .ini files.

TheHurt
You beat me by 21 seconds.
Charlie Salts
Great minds think alike :)
TheHurt
+1  A: 

The app.config file is renamed to YourAssemblyName.exe.config during the build process. This is the default behaviour for all non-web projects. A web or web application project uses web.config instead, but it is not renamed.

devstuff