Microsoft.Extensions.Configuration.CommandLine (9.0.10)

Published 2026-02-20 20:22:47 +03:30 by kayer

Installation

dotnet nuget add source --name kayer --username your_username --password your_token 
dotnet add package --source kayer --version 9.0.10 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 9.0.10 .NETFramework4.6.2
Microsoft.Extensions.Configuration 9.0.10 .NETFramework4.6.2
Microsoft.Extensions.Configuration.Abstractions 9.0.10 .NETStandard2.0
Microsoft.Extensions.Configuration 9.0.10 .NETStandard2.0
Microsoft.Extensions.Configuration.Abstractions 9.0.10 net8.0
Microsoft.Extensions.Configuration 9.0.10 net8.0
Microsoft.Extensions.Configuration.Abstractions 9.0.10 net9.0
Microsoft.Extensions.Configuration 9.0.10 net9.0
Details
NuGet
2026-02-20 20:22:47 +03:30
45
Microsoft
119 KiB
Assets (2)
Versions (2) View all
9.0.10 2026-02-20
9.0.0 2026-02-20