Microsoft.Extensions.Configuration.CommandLine (10.0.11)

Published 2026-09-09 02:39:00 +03:30 by kayer

Installation

dotnet nuget add source --name kayer --username your_username --password your_token 
dotnet add package --source kayer --version 10.0.11 Microsoft.Extensions.Configuration.CommandLine

About this package

Command line configuration provider implementation for Microsoft.Extensions.Configuration. This package enables you to read configuration parameters from the command line arguments of your application. You can use CommandLineConfigurationExtensions.AddCommandLine extension method on IConfigurationBuilder to add the command line configuration provider to the configuration builder.

About

Command line configuration provider implementation for Microsoft.Extensions.Configuration. This package enables you to read configuration parameters from the command line arguments of your application. You can use CommandLineConfigurationExtensions.AddCommandLine extension method on IConfigurationBuilder to add the command line configuration provider to the configuration builder.

How to Use

The following example shows how to read application configuration from the command line. You can use a command like dotnet run --InputPath "c:\fizz" --OutputPath "c:\buzz" to run it.

using System;
using Microsoft.Extensions.Configuration;

class Program
{
    static void Main(string[] args)
    {
        // Build a configuration object from command line
        IConfiguration config = new ConfigurationBuilder()
            .AddCommandLine(args)
            .Build();

        // Read configuration values
        Console.WriteLine($"InputPath: {config["InputPath"]}");
        Console.WriteLine($"OutputPath: {config["OutputPath"]}");
    }
}

Additional Documentation

Feedback & Contributing

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

Dependencies

ID Version Target Framework
Microsoft.Extensions.Configuration.Abstractions 10.0.11 .NETFramework4.6.2
Microsoft.Extensions.Configuration 10.0.11 .NETFramework4.6.2
Microsoft.Extensions.Configuration.Abstractions 10.0.11 .NETStandard2.0
Microsoft.Extensions.Configuration 10.0.11 .NETStandard2.0
Microsoft.Extensions.Configuration.Abstractions 10.0.11 net10.0
Microsoft.Extensions.Configuration 10.0.11 net10.0
Microsoft.Extensions.Configuration.Abstractions 10.0.11 net8.0
Microsoft.Extensions.Configuration 10.0.11 net8.0
Microsoft.Extensions.Configuration.Abstractions 10.0.11 net9.0
Microsoft.Extensions.Configuration 10.0.11 net9.0
Details
NuGet
2026-09-09 02:39:00 +03:30
9
Microsoft
134 KiB
Assets (2)
Versions (3) View all
10.0.11 2026-09-09
9.0.10 2026-02-20
9.0.0 2026-02-20