How to: Add an application configuration file to a C# project
Applies to: Visual Studio
Visual Studio for Mac
Visual Studio Code
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 or about assemblies in .NET, see How the runtime locates assemblies (.NET Framework) and Assemblies in .NET.
Note
UWP apps don't contain an app.config file.
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 a C# project
In Solution Explorer, right-click the project node, and then select Add > New Item.
The Add New Item dialog box appears.
Expand Installed > Visual C# Items.
In the middle pane, select the Application Configuration File template.
Select the Add button.
A file named App.config is added to your project.
See also
Feedback
Submit and view feedback for