System.Configuration.ConfigurationManager 9.0.4

Prefix Reserved
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package System.Configuration.ConfigurationManager --version 9.0.4
                    
NuGet\Install-Package System.Configuration.ConfigurationManager -Version 9.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="System.Configuration.ConfigurationManager" Version="9.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.4" />
                    
Directory.Packages.props
<PackageReference Include="System.Configuration.ConfigurationManager" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add System.Configuration.ConfigurationManager --version 9.0.4
                    
#r "nuget: System.Configuration.ConfigurationManager, 9.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=System.Configuration.ConfigurationManager&version=9.0.4
                    
Install System.Configuration.ConfigurationManager as a Cake Addin
#tool nuget:?package=System.Configuration.ConfigurationManager&version=9.0.4
                    
Install System.Configuration.ConfigurationManager as a Cake Tool

About

Provides types that support using XML configuration files (app.config). This package exists only to support migrating existing .NET Framework code that already uses System.Configuration. When writing new code, use another configuration system instead, such as Microsoft.Extensions.Configuration.

How to Use

The following example shows how to read and modify the application configuration settings.

using System;
using System.Configuration;

class Program
{
    static void Main()
    {
        try
        {
            // Open current application configuration
            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            KeyValueConfigurationCollection section = config.AppSettings.Settings;

            // Print settings from configuration file
            foreach (string key in section.AllKeys)
            {
                Console.WriteLine($"{key}: {section[key].Value}");
            }

            // Add new setting
            section.Add("Database", "TestDatabase");

            // Change existing setting
            section["Username"].Value = "TestUser";

            // Save changes to file
            config.Save(ConfigurationSaveMode.Modified);
            ConfigurationManager.RefreshSection(config.AppSettings.SectionInformation.Name);
        }
        catch (ConfigurationErrorsException ex)
        {
            Console.WriteLine("Error reading configuration: ");
            Console.WriteLine(ex.Message);
        }
    }
}

To run this example, include an app.config file with the following content in your project:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="Server" value="example.com"/>
    <add key="Username" value="Admin"/>
  </appSettings>
</configuration>

Main Types

The main types provided by this library are:

  • System.Configuration.Configuration
  • System.Configuration.ConfigurationManager

Additional Documentation

Feedback & Contributing

System.Configuration.ConfigurationManager is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2.4K)

Showing the top 5 NuGet packages that depend on System.Configuration.ConfigurationManager:

Package Downloads
System.Runtime.Caching

Provides classes to use caching facilities. Commonly Used Types: System.Runtime.Caching.CacheEntryChangeMonitor System.Runtime.Caching.CacheEntryRemovedArguments System.Runtime.Caching.CacheEntryUpdateArguments System.Runtime.Caching.CacheItem System.Runtime.Caching.CacheItemPolicy System.Runtime.Caching.ChangeMonitor System.Runtime.Caching.FileChangeMonitor System.Runtime.Caching.HostFileChangeMonitor System.Runtime.Caching.MemoryCache System.Runtime.Caching.ObjectCache

Microsoft.Data.SqlClient

The current data provider for SQL Server and Azure SQL databases. This has replaced System.Data.SqlClient. These classes provide access to SQL and encapsulate database-specific protocols, including tabular data stream (TDS). Commonly Used Types: Microsoft.Data.SqlClient.SqlConnection Microsoft.Data.SqlClient.SqlException Microsoft.Data.SqlClient.SqlParameter Microsoft.Data.SqlClient.SqlDataReader Microsoft.Data.SqlClient.SqlCommand Microsoft.Data.SqlClient.SqlTransaction Microsoft.Data.SqlClient.SqlParameterCollection Microsoft.Data.SqlClient.SqlClientFactory When using NuGet 3.x this package requires at least version 3.4.

System.Diagnostics.PerformanceCounter

Provides the System.Diagnostics.PerformanceCounter class, which allows access to Windows performance counters. Commonly Used Types: System.Diagnostics.PerformanceCounter

EntityFramework

Entity Framework 6 (EF6) is a tried and tested object-relational mapper for .NET with many years of feature development and stabilization.

log4net

log4net is a tool to help the programmer output log statements to a variety of output targets. In case of problems with an application, it is helpful to enable logging so that the problem can be located. With log4net it is possible to enable logging at runtime without modifying the application binary. The log4net package is designed so that log statements can remain in shipped code without incurring a high performance cost. It follows that the speed of logging (or rather not logging) is crucial. At the same time, log output can be so voluminous that it quickly becomes overwhelming. One of the distinctive features of log4net is the notion of hierarchical loggers. Using these loggers it is possible to selectively control which log statements are output at arbitrary granularity. log4net is designed with two distinct goals in mind: speed and flexibility

GitHub repositories (286)

Showing the top 20 popular GitHub repositories that depend on System.Configuration.ConfigurationManager:

Repository Stars
microsoft/PowerToys
Windows system utilities to maximize productivity
PowerShell/PowerShell
PowerShell for every system!
dotnet/roslyn
The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
jasontaylordev/CleanArchitecture
Clean Architecture Solution Template for ASP.NET Core
aspnetboilerplate/aspnetboilerplate
ASP.NET Boilerplate - Web Application Framework
Sonarr/Sonarr
Smart PVR for newsgroup and bittorrent users.
Radarr/Radarr
Movie organizer/manager for usenet and torrent users.
dotnet/BenchmarkDotNet
Powerful .NET library for benchmarking
nopSolutions/nopCommerce
ASP.NET Core eCommerce software. nopCommerce is a free and open-source shopping cart.
MahApps/MahApps.Metro
A framework that allows developers to cobble together a better UI for their own WPF applications with minimal effort.
mRemoteNG/mRemoteNG
mRemoteNG is the next generation of mRemote, open source, tabbed, multi-protocol, remote connections manager.
dotnet/machinelearning
ML.NET is an open source and cross-platform machine learning framework for .NET.
XINCGer/Unity3DTraining
【Unity杂货铺】unity大杂烩~
microsoft/ailab
Experience, Learn and Code the latest breakthrough innovations with Microsoft AI
dotnet/wpf
WPF is a .NET Core UI framework for building Windows desktop applications.
nissl-lab/npoi
a .NET library that can read/write Office formats without Microsoft Office installed. No COM+, no interop.
win-acme/win-acme
A simple ACME client for Windows (for use with Let's Encrypt et al.)
dotnet/msbuild
The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
TechnitiumSoftware/DnsServer
Technitium DNS Server
akkadotnet/akka.net
Canonical actor model implementation for .NET with local + distributed actors in C# and F#.
Version Downloads Last updated
10.0.0-preview.3.25171.5 414 4/10/2025
10.0.0-preview.2.25163.2 6,422 3/18/2025
10.0.0-preview.1.25080.5 6,524 2/25/2025
9.0.4 58,618 4/8/2025
9.0.3 846,075 3/11/2025
9.0.2 1,497,907 2/11/2025
9.0.1 2,005,032 1/14/2025
9.0.0 6,670,786 11/12/2024
9.0.0-rc.2.24473.5 90,361 10/8/2024
9.0.0-rc.1.24431.7 33,252 9/10/2024
9.0.0-preview.7.24405.7 30,150 8/13/2024
9.0.0-preview.6.24327.7 35,956 7/9/2024
9.0.0-preview.5.24306.7 21,021 6/11/2024
9.0.0-preview.4.24266.19 17,823 5/21/2024
9.0.0-preview.3.24172.9 33,056 4/11/2024
9.0.0-preview.2.24128.5 32,486 3/12/2024
9.0.0-preview.1.24080.9 51,283 2/13/2024
8.0.1 18,062,953 10/8/2024
8.0.0 111,189,889 11/14/2023
8.0.0-rc.2.23479.6 240,987 10/10/2023
8.0.0-rc.1.23419.4 141,152 9/12/2023
8.0.0-preview.7.23375.6 62,865 8/8/2023
8.0.0-preview.6.23329.7 37,787 7/11/2023
8.0.0-preview.5.23280.8 38,906 6/13/2023
8.0.0-preview.4.23259.5 81,675 5/16/2023
8.0.0-preview.3.23174.8 75,351 4/11/2023
8.0.0-preview.2.23128.3 44,031 3/14/2023
8.0.0-preview.1.23110.8 58,370 2/21/2023
7.0.0 74,769,588 11/7/2022
7.0.0-rc.2.22472.3 175,046 10/11/2022
7.0.0-rc.1.22426.10 142,008 9/14/2022
7.0.0-preview.7.22375.6 41,104 8/9/2022
7.0.0-preview.6.22324.4 41,235 7/12/2022
7.0.0-preview.5.22301.12 46,350 6/14/2022
7.0.0-preview.4.22229.4 30,800 5/10/2022
7.0.0-preview.3.22175.4 14,004 4/13/2022
7.0.0-preview.2.22152.2 31,812 3/14/2022
7.0.0-preview.1.22076.8 25,268 2/17/2022
6.0.2 398,025 11/12/2024
6.0.1 196,165,499 9/13/2022
6.0.0 298,007,790 11/8/2021
6.0.0-rc.2.21480.5 58,791 10/12/2021
6.0.0-rc.1.21451.13 67,733 9/14/2021
6.0.0-preview.7.21377.19 68,342 8/10/2021
6.0.0-preview.6.21352.12 60,675 7/14/2021
6.0.0-preview.5.21301.5 48,646 6/15/2021
6.0.0-preview.4.21253.7 59,398 5/24/2021
6.0.0-preview.3.21201.4 230,074 4/8/2021
6.0.0-preview.2.21154.6 69,740 3/11/2021
6.0.0-preview.1.21102.12 152,053 2/12/2021
5.0.0 326,553,274 11/9/2020 5.0.0 is deprecated because it is no longer maintained.
5.0.0-rc.2.20475.5 93,265 10/13/2020
5.0.0-rc.1.20451.14 64,677 9/14/2020
5.0.0-preview.8.20407.11 165,433 8/25/2020
5.0.0-preview.7.20364.11 132,449 7/21/2020
5.0.0-preview.6.20305.6 39,636 6/25/2020
5.0.0-preview.5.20278.1 38,166 6/10/2020
5.0.0-preview.4.20251.6 80,310 5/18/2020
5.0.0-preview.3.20214.6 66,633 4/23/2020
5.0.0-preview.2.20160.6 67,890 4/2/2020
5.0.0-preview.1.20120.5 58,807 3/16/2020
4.7.0 523,127,028 12/3/2019
4.7.0-preview3.19551.4 71,477 11/13/2019
4.7.0-preview2.19523.17 26,698 11/1/2019
4.7.0-preview1.19504.10 35,687 10/15/2019
4.6.0 56,680,860 9/23/2019
4.6.0-rc1.19456.4 68,186 9/16/2019
4.6.0-preview9.19421.4 27,128 9/4/2019
4.6.0-preview9.19416.11 1,088 9/4/2019
4.6.0-preview8.19405.3 105,232 8/13/2019
4.6.0-preview7.19362.9 263,457 7/23/2019
4.6.0-preview6.19303.8 1,377,368 6/12/2019
4.6.0-preview6.19264.9 1,140 9/4/2019
4.6.0-preview5.19224.8 64,388 5/6/2019
4.6.0-preview4.19212.13 14,534 4/18/2019
4.6.0-preview3.19128.7 80,053 3/6/2019
4.6.0-preview.19073.11 62,165 1/29/2019
4.6.0-preview.18571.3 133,990 12/3/2018
4.5.0 480,440,655 5/29/2018
4.5.0-rc1 219,775 5/6/2018
4.5.0-preview2-26406-04 498,316 4/10/2018
4.5.0-preview1-26216-02 490,588 2/26/2018
4.5.0-preview1-25914-04 681,627 11/15/2017
4.4.1 132,354,318 12/12/2017
4.4.0 345,899,100 8/11/2017
4.4.0-preview2-25405-01 141,734 6/27/2017
4.4.0-preview1-25305-02 8,781 5/9/2017