Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is app.config for?

Settings.settings generates Settings.Designer.cs which presumably generates app.config which then is copied to output directory as Foo.exe.config. When I distribute the application without the config file, nothing bad seems to happen. So, what is that file for?

like image 410
CannibalSmith Avatar asked Sep 16 '09 08:09

CannibalSmith


People also ask

Do I need app config?

config are only required, if you have coded your application in such a way that it is explicitly dependent on it. If you have not done this, or have put error handling/default values or actions in place where it can't read the config file, one would assume your application could run without it.

What does configure an app mean?

To "configure your app," generally speaking, is to specify, via some mechanism, parameters that can be used to direct the behavior of your app at runtime. Additionally, in the case of Google App Engine, these parameters can affect the behavior of the framework and services surrounding your app.

What does app config do in C#?

By adding an application configuration file (app. config file) to a C# project, you can customize how the common language runtime locates and loads assembly files. For more information about application configuration files, see How the runtime locates assemblies (. NET Framework).

What is app config in Java?

The AppConfig class is a representation of the configuration of your Java application. You pass an AppConfig object into the security runtime instance when you initialize it. The AppConfig object is used to configure the security runtime based upon the configuration of your application.


1 Answers

If you don't have the config file, it uses the default values from the designer. However, the config file allows users/administrators to easily change settings - such as the server you talk to, themes, etc. If you don't have the file, where would you expect those settings to be stored?

You can have per-user settings as well as per-application settings, which are stored in different locations.

like image 155
Jon Skeet Avatar answered Sep 22 '22 21:09

Jon Skeet