System.Configuration.ConfigurationManager 9.0.6
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
- Configure apps by using configuration files
- System.Configuration namespace
- System.Configuration.Configuration
- System.Configuration.ConfigurationManager
Feedback & Contributing
System.Configuration.ConfigurationManager is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
Showing the top 20 packages that depend on System.Configuration.ConfigurationManager.
Packages | Downloads |
---|---|
Microsoft.CodeAnalysis.Workspaces.MSBuild
.NET Compiler Platform ("Roslyn") support for analyzing MSBuild projects and solutions. This should be used with at least one
of the following packages to add the appropriate language support:
- Microsoft.CodeAnalysis.CSharp.Workspaces
- Microsoft.CodeAnalysis.VisualBasic.Workspaces
More details at https://aka.ms/roslyn-packages
This package was built from the source at https://github.com/dotnet/roslyn/commit/fa72fa61b0d822ea8a3fbeb96f668340419ab5cd.
|
15 |
Microsoft.Build.Utilities.Core
This package contains the Microsoft.Build.Utilities assembly which is used to implement custom MSBuild tasks.
|
12 |
System.DirectoryServices.AccountManagement
Provides uniform access and manipulation of user, computer, and group security principals across the multiple principal stores: Active Directory Domain Services (AD DS), Active Directory Lightweight Directory Services (AD LDS), and Machine SAM (MSAM).
|
11 |
Microsoft.Build.Tasks.Core
This package contains the Microsoft.Build.Tasks assembly which implements the commonly used tasks of MSBuild.
|
10 |
Microsoft.Build.Utilities.Core
This package contains the Microsoft.Build.Utilities assembly which is used to implement custom MSBuild tasks.
|
10 |
System.Diagnostics.PerformanceCounter
Provides the System.Diagnostics.PerformanceCounter class, which allows access to Windows performance counters.
Commonly Used Types:
System.Diagnostics.PerformanceCounter
|
10 |
Z.EntityFramework.Extensions.EFCore
Microsoft.EntityFrameworkCore Extension Methods
Entity Framework Extensions extends your DbContext with high-performance bulk operations: BulkSaveChanges, BulkInsert, BulkUpdate, BulkDelete, BulkMerge, and more.
Support: SQL Server, MySQL, Oracle, PostgreSQL, SQLite, and more!
Example: https://dotnetfiddle.net/RQ0kFz
Benchmark: https://dotnetfiddle.net/vZQnZt
**IMPORTANT**
- For EF Core 9.x, use the latest EF Extensions v9.x version
- For EF Core 8.x, use the latest EF Extensions v8.x version
- For EF Core 7.x, use the latest EF Extensions v7.x version
- For EF Core 6.x, use the latest EF Extensions v6.x version
- For EF Core 5.x, use the latest EF Extensions v5.x version
- For EF Core 3.x, use the latest EF Extensions v3.x version
- For EF Core 2.x, use the latest EF Extensions v2.x version
Include free and prime features.
|
9 |
Microsoft.Build.Tasks.Core
This package contains the Microsoft.Build.Tasks assembly which implements the commonly used tasks of MSBuild.
|
9 |
Microsoft.Windows.Compatibility
This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET as well as .NET Standard.
|
9 |
Microsoft.Windows.Compatibility
This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET Core as well as .NET Standard.
When using NuGet 3.x this package requires at least version 3.4.
|
9 |
Microsoft.Build.Runtime
This package delivers a complete executable copy of MSBuild. Reference this package only if your application needs to load projects or execute in-process builds without requiring installation of MSBuild. Successfully evaluating projects using this package requires aggregating additional components (like the compilers) into an application directory.
|
9 |
System.Diagnostics.PerformanceCounter
Provides the System.Diagnostics.PerformanceCounter class, which allows access to Windows performance counters.
Commonly Used Types:
System.Diagnostics.PerformanceCounter
When using NuGet 3.x this package requires at least version 3.4.
|
9 |
System.Diagnostics.PerformanceCounter
Provides the System.Diagnostics.PerformanceCounter class, which allows access to Windows performance counters.
Commonly Used Types:
System.Diagnostics.PerformanceCounter
|
9 |
FluentAssertions
A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or
BDD-style unit tests. Targets .NET Framework 4.7, .NET Core 2.1 and 3.0, .NET 6, as well as .NET Standard 2.0 and 2.1.
Supports the unit test frameworks MSTest2, NUnit3, XUnit2, MSpec, and NSpec3.
Supported by InfoSupport B.V.
|
9 |
.NET Framework 4.6.2
- No dependencies.
.NET 8.0
- System.Diagnostics.EventLog (>= 9.0.6)
- System.Security.Cryptography.ProtectedData (>= 9.0.6)
.NET 9.0
- System.Diagnostics.EventLog (>= 9.0.6)
- System.Security.Cryptography.ProtectedData (>= 9.0.6)
.NET Standard 2.0
- System.Security.Cryptography.ProtectedData (>= 9.0.6)