WCF uses the System.Configuration Configuration System of the. NET Framework.
When configuring a service in Visual Studio, use either a Web. config file or an app. config file to specify the settings. The choice of the configuration file name is determined by the hosting environment your choose for the service. If you are using the IIS to host your service, use a Web. config file. If you is using any other hosting environment, use an app. config file.
In Visual Studio, the file named App. Config is used to create the final configuration file. The final name actually used for the configuration depends on the assembly name. For example, an assembly named "Cohowinery.exe" have a final configuration file name of "Cohowinery.exe.config". However, you have need to modify the app. Config file. Changes made to that file is automatically made to the final application configuration file at compile time.
In using an app. config, file the configuration system merges the. config file with content of the Machine.config file W Hen the application starts and the configuration is applied. This mechanism allows Machine-wide settings to being defined in the Machine.config file. The app. Config file can used to override the settings of the Machine.config file; You can also lock in the settings in Machine.config file so that they get used. In the Web. config case, the configuration system merges the Web. config files in all directories leading the Applicat Ion directory into the configuration that gets applied. For more information on the configuration and the setting priorities, see topics in the System.Configuration namespace.
Extracted from msdn:https://msdn.microsoft.com/en-us/library/ms733932 (v=vs.110). aspx
Web. config and application. config in WCF development