App.config (.NET)

A standard configuration file for .NET Framework apps.

Open in XML Formatter

About this format

Older .NET applications heavily rely on XML configuration files like App.config to manage environment variables and database connections.

Example Data

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="Environment" value="Production" />
    <add key="TimeoutMs" value="5000" />
  </appSettings>
  <connectionStrings>
    <add name="DefaultDB"
         connectionString="Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;" />
  </connectionStrings>
</configuration>

When to use App.config (.NET)

  • Storing database connection strings
  • Setting environment-specific keys
  • Configuring .NET runtime behaviors