We recommend using Visual Studio 2017

How to: Add an Application Configuration File to a C# Project


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

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.

System_CAPS_ICON_note.jpg Note

The Windows Store doesn’t support System.Configuration. As a result, Store apps don’t contain an app.config template.

When you build your project, the development environment automatically copies your app.config file, changes the file name of the copy to match your executable, and then moves the copy to the bin directory.

To add an application configuration file to your C# project

  1. On the menu bar, choose Project, Add New Item.

    The Add New Item dialog box appears.

  2. Expand Installed, expand Visual C# Items, and then choose the Application Configuration File template.

  3. In the Name text box, enter a name, and then choose the Add button.

    A file that's named app.config is added to your project.

Managing Application Settings (.NET)
Configuration File Schema
Configuring Apps
How to: Configure an App to Target a .NET Framework Version
Using the Visual Studio Development Environment for C#