views:

52

answers:

4

I find some of the .NET execution files have accompanying .config file. For example, I have LINQPad.exe and LINQPad.exe.config.

What's this LINQPad.exe.config for?

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
  </startup>
  <runtime>
    <legacyUnhandledExceptionPolicy enabled="1" />
  </runtime>
</configuration>
+4  A: 

It's used for storing the application settings.

See: http://msdn.microsoft.com/en-us/library/8eyb2ct1.aspx

+2  A: 

It provides configuration information for the program, similar to how a .ini file works for programs developed in other environments.

There's a nice relatively non-techie explanation here: http://www.developer.com/net/net/article.php/3396111/Using-Application-Configuration-Files-in-NET.htm

The most common use for it is storing application settings, such as connection strings so that you can change them without having to recompile the program.

David Stratton
+3  A: 

It's the configuration file specific to it's associated .exe

Configs allow for some settings to be changed without needing to recompile the application. Quite often a config file contains a mix of default values, and user-elected settings.

There are other levels of configs as well, such as machine.config, or in the case of ASP.NET, web.config

STW
+3  A: 

Config files are used to save configuration settings external to the actual program. This way, changes can be made independently of the actual application. XML is chosen because it standardises the config files, which makes it easier to create without having to develop custom parsers for different applications. It also means that .NET framework can have APIs for developers to use when it comes to modifying the config files (System.Configuration).

keyboardP