Microsoft.Extensions.Configuration.CommandLine 11.0.0-preview.3.26207.106

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.

Showing the top 20 packages that depend on Microsoft.Extensions.Configuration.CommandLine.

Packages Downloads
Microsoft.AspNetCore
Microsoft.AspNetCore
21
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
15
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
16
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
27
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
31
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
32
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications. When using NuGet 3.x this package requires at least version 3.4.
16
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
15
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
16
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
17

.NET Framework 4.6.2

.NET 10.0

.NET 11.0

.NET Standard 2.0

Version Downloads Last updated
11.0.0-preview.3.26207.106 1 27.04.2026
11.0.0-preview.2.26159.112 3 15.03.2026
11.0.0-preview.1.26104.118 4 12.02.2026
10.0.7 1 27.04.2026
10.0.6 1 27.04.2026
10.0.5 5 14.03.2026
10.0.4 3 14.03.2026
10.0.3 3 12.02.2026
10.0.2 8 22.01.2026
10.0.1 7 18.12.2025
10.0.0 8 18.12.2025
10.0.0-rc.2.25502.107 5 22.01.2026
10.0.0-rc.1.25451.107 5 20.12.2025
10.0.0-preview.7.25380.108 6 22.08.2025
10.0.0-preview.6.25358.103 7 08.08.2025
10.0.0-preview.5.25277.114 12 08.06.2025
10.0.0-preview.4.25258.110 15 23.05.2025
10.0.0-preview.3.25171.5 11 23.05.2025
10.0.0-preview.2.25163.2 13 01.06.2025
10.0.0-preview.1.25080.5 13 13.03.2025
9.0.15 1 27.04.2026
9.0.14 7 14.03.2026
9.0.13 3 12.02.2026
9.0.12 13 22.01.2026
9.0.11 6 18.12.2025
9.0.10 8 25.10.2025
9.0.9 8 16.09.2025
9.0.8 18 21.08.2025
9.0.7 12 05.08.2025
9.0.6 12 25.06.2025
9.0.5 32 23.05.2025
9.0.4 20 23.05.2025
9.0.3 16 13.03.2025
9.0.2 15 14.03.2025
9.0.1 16 24.01.2025
9.0.0 24 30.12.2024
9.0.0-rc.2.24473.5 10 01.01.2025
9.0.0-rc.1.24431.7 12 31.12.2024
9.0.0-preview.7.24405.7 11 31.12.2024
9.0.0-preview.6.24327.7 12 01.01.2025
9.0.0-preview.5.24306.7 14 01.01.2025
9.0.0-preview.4.24266.19 11 19.07.2024
9.0.0-preview.3.24172.9 15 01.01.2025
9.0.0-preview.2.24128.5 13 19.07.2024
9.0.0-preview.1.24080.9 13 28.07.2024
8.0.0 45 02.07.2024
8.0.0-rc.2.23479.6 12 31.12.2024
8.0.0-rc.1.23419.4 11 01.01.2025
8.0.0-preview.7.23375.6 11 21.07.2024
8.0.0-preview.6.23329.7 13 01.01.2025
8.0.0-preview.5.23280.8 13 04.07.2024
8.0.0-preview.4.23259.5 18 21.07.2024
8.0.0-preview.3.23174.8 14 02.01.2025
8.0.0-preview.2.23128.3 12 01.01.2025
8.0.0-preview.1.23110.8 12 31.12.2024
7.0.0 19 20.07.2024
7.0.0-rc.2.22472.3 15 01.01.2025
7.0.0-rc.1.22426.10 13 24.07.2024
7.0.0-preview.7.22375.6 13 04.07.2024
7.0.0-preview.6.22324.4 13 26.07.2024
7.0.0-preview.5.22301.12 13 31.12.2024
7.0.0-preview.4.22229.4 13 26.07.2024
7.0.0-preview.3.22175.4 14 17.07.2024
7.0.0-preview.2.22152.2 13 04.07.2024
7.0.0-preview.1.22076.8 13 31.12.2024
6.0.1 15 01.01.2025
6.0.0 16 22.07.2024
6.0.0-rc.2.21480.5 13 24.01.2025
6.0.0-rc.1.21451.13 12 31.12.2024
6.0.0-preview.7.21377.19 16 27.07.2024
6.0.0-preview.6.21352.12 9 01.01.2025
6.0.0-preview.5.21301.5 13 26.07.2024
6.0.0-preview.4.21253.7 12 18.07.2024
6.0.0-preview.3.21201.4 13 17.07.2024
6.0.0-preview.2.21154.6 11 31.12.2024
6.0.0-preview.1.21102.12 11 27.01.2025
5.0.0 25 01.01.2025
5.0.0-rc.2.20475.5 10 01.01.2025
5.0.0-rc.1.20451.14 11 28.01.2025
5.0.0-preview.8.20407.11 10 31.12.2024
5.0.0-preview.7.20364.11 17 20.07.2024
5.0.0-preview.6.20305.6 15 21.07.2024
5.0.0-preview.5.20278.1 11 31.12.2024
5.0.0-preview.4.20251.6 11 16.07.2024
5.0.0-preview.3.20215.2 11 01.01.2025
5.0.0-preview.2.20160.3 10 02.01.2025
5.0.0-preview.1.20120.4 17 01.01.2025
3.1.32 16 02.01.2025
3.1.31 17 21.07.2024
3.1.30 16 01.01.2025
3.1.29 19 04.07.2024
3.1.28 15 01.01.2025
3.1.27 15 31.12.2024
3.1.26 15 31.12.2024
3.1.25 17 04.07.2024
3.1.24 13 31.12.2024
3.1.23 15 01.01.2025
3.1.22 18 01.01.2025
3.1.21 19 20.07.2024
3.1.20 15 15.07.2024
3.1.19 21 21.07.2024
3.1.18 17 26.07.2024
3.1.17 17 20.07.2024
3.1.16 16 04.07.2024
3.1.15 20 18.07.2024
3.1.14 18 03.01.2025
3.1.13 17 01.01.2025
3.1.12 16 20.07.2024
3.1.11 18 26.07.2024
3.1.10 21 01.01.2025
3.1.9 14 01.01.2025
3.1.8 17 20.07.2024
3.1.7 18 29.07.2024
3.1.6 18 26.07.2024
3.1.5 15 31.12.2024
3.1.4 16 18.07.2024
3.1.3 15 21.07.2024
3.1.2 24 01.01.2025
3.1.1 18 21.07.2024
3.1.0 19 16.07.2024
3.1.0-preview3.19553.2 13 27.07.2024
3.1.0-preview2.19525.4 11 04.07.2024
3.1.0-preview1.19506.1 17 27.07.2024
3.0.3 14 31.12.2024
3.0.2 18 27.07.2024
3.0.1 23 01.01.2025
3.0.0 15 01.01.2025
3.0.0-rc1.19456.10 22 17.07.2024
3.0.0-preview9.19423.4 13 04.07.2024
3.0.0-preview8.19405.4 11 18.07.2024
3.0.0-preview7.19362.4 14 31.12.2024
3.0.0-preview6.19304.6 12 18.07.2024
3.0.0-preview5.19227.9 13 01.01.2025
3.0.0-preview4.19216.2 14 15.07.2024
3.0.0-preview3.19153.1 13 20.07.2024
3.0.0-preview.19074.2 13 20.07.2024
3.0.0-preview.18572.1 10 21.07.2024
2.2.0 15 31.12.2024
2.2.0-preview3-35497 16 04.07.2024
2.2.0-preview2-35157 11 19.07.2024
2.2.0-preview1-35029 9 20.07.2024
2.1.1 20 15.07.2024
2.1.0 16 31.12.2024
2.1.0-rc1-final 12 06.01.2025
2.1.0-preview2-final 14 01.01.2025
2.1.0-preview1-final 15 29.07.2024
2.0.2 16 02.01.2025
2.0.1 15 31.12.2024
2.0.0 16 01.01.2025
2.0.0-preview2-final 11 02.01.2025
2.0.0-preview1-final 14 04.07.2024
1.1.2 20 18.07.2024
1.1.1 19 20.07.2024
1.1.0 15 31.12.2024
1.1.0-preview1-final 15 01.01.2025
1.0.2 16 23.07.2024
1.0.1 16 04.07.2024
1.0.0 15 24.07.2024
1.0.0-rc2-final 14 04.07.2024
1.0.0-rc1-final 15 24.07.2024