Microsoft.Extensions.Configuration.CommandLine 10.0.12

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.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
72
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
72
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
71
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
71
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
70
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
70
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications. When using NuGet 3.x this package requires at least version 3.4.
70
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
69
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
69

https://go.microsoft.com/fwlink/?LinkID=799421

Version Downloads Last updated
11.0.0-rc.3.26522.148 3 10/26/2026
11.0.0-rc.2.26504.105 8 10/15/2026
11.0.0-rc.1.26425.128 14 09/09/2026
11.0.0-preview.7.26381.103 15 08/11/2026
11.0.0-preview.6.26359.118 20 07/16/2026
11.0.0-preview.5.26302.115 23 06/11/2026
11.0.0-preview.4.26230.115 35 05/14/2026
11.0.0-preview.3.26207.106 39 04/16/2026
11.0.0-preview.2.26159.112 41 03/11/2026
11.0.0-preview.1.26104.118 51 02/13/2026
10.0.14 3 10/26/2026
10.0.13 8 10/15/2026
10.0.12 14 09/09/2026
10.0.11 17 08/11/2026
10.0.10 21 07/16/2026
10.0.9 30 06/11/2026
10.0.8 32 05/14/2026
10.0.7 30 04/23/2026
10.0.6 34 04/16/2026
10.0.5 36 03/13/2026
10.0.4 43 03/11/2026
10.0.3 43 02/13/2026
10.0.2 48 01/18/2026
10.0.1 49 12/09/2025
10.0.0 54 11/14/2025
10.0.0-rc.2.25502.107 73 10/19/2025
10.0.0-rc.1.25451.107 75 09/20/2025
10.0.0-preview.7.25380.108 73 09/05/2025
10.0.0-preview.6.25358.103 80 09/05/2025
10.0.0-preview.5.25277.114 81 09/05/2025
10.0.0-preview.4.25258.110 70 09/05/2025
10.0.0-preview.3.25171.5 78 09/05/2025
10.0.0-preview.2.25163.2 74 09/05/2025
10.0.0-preview.1.25080.5 77 09/05/2025
9.0.22 3 10/26/2026
9.0.21 8 10/15/2026
9.0.20 14 09/09/2026
9.0.19 22 08/11/2026
9.0.18 19 07/16/2026
9.0.17 28 06/11/2026
9.0.16 35 05/14/2026
9.0.15 34 04/16/2026
9.0.14 42 03/11/2026
9.0.13 43 02/13/2026
9.0.12 54 01/18/2026
9.0.11 55 11/15/2025
9.0.10 61 10/19/2025
9.0.9 72 09/21/2025
9.0.8 69 09/05/2025
9.0.7 69 09/05/2025
9.0.6 68 09/05/2025
9.0.5 70 09/05/2025
9.0.4 69 09/05/2025
9.0.3 66 09/05/2025
9.0.2 68 09/05/2025
9.0.1 70 09/05/2025
9.0.0 72 09/05/2025
9.0.0-rc.2.24473.5 82 09/05/2025
9.0.0-rc.1.24431.7 80 09/05/2025
9.0.0-preview.7.24405.7 83 09/05/2025
9.0.0-preview.6.24327.7 79 09/05/2025
9.0.0-preview.5.24306.7 80 09/05/2025
9.0.0-preview.4.24266.19 74 09/05/2025
9.0.0-preview.3.24172.9 71 09/05/2025
9.0.0-preview.2.24128.5 75 09/05/2025
9.0.0-preview.1.24080.9 75 09/05/2025
8.0.0 72 09/05/2025
8.0.0-rc.2.23479.6 74 09/05/2025
8.0.0-rc.1.23419.4 78 09/05/2025
8.0.0-preview.7.23375.6 77 09/05/2025
8.0.0-preview.6.23329.7 80 09/05/2025
8.0.0-preview.5.23280.8 81 09/05/2025
8.0.0-preview.4.23259.5 77 09/05/2025
8.0.0-preview.3.23174.8 77 09/05/2025
8.0.0-preview.2.23128.3 76 09/05/2025
8.0.0-preview.1.23110.8 78 09/05/2025
7.0.0 70 09/05/2025
7.0.0-rc.2.22472.3 81 09/05/2025
7.0.0-rc.1.22426.10 79 09/05/2025
7.0.0-preview.7.22375.6 74 09/05/2025
7.0.0-preview.6.22324.4 69 09/05/2025
7.0.0-preview.5.22301.12 80 09/05/2025
7.0.0-preview.4.22229.4 81 09/05/2025
7.0.0-preview.3.22175.4 76 09/05/2025
7.0.0-preview.2.22152.2 80 09/05/2025
7.0.0-preview.1.22076.8 78 09/05/2025
6.0.1 72 09/05/2025
6.0.0 71 09/05/2025
6.0.0-rc.2.21480.5 76 09/05/2025
6.0.0-rc.1.21451.13 75 09/05/2025
6.0.0-preview.7.21377.19 84 09/05/2025
6.0.0-preview.6.21352.12 80 09/05/2025
6.0.0-preview.5.21301.5 80 09/05/2025
6.0.0-preview.4.21253.7 75 09/05/2025
6.0.0-preview.3.21201.4 80 09/05/2025
6.0.0-preview.2.21154.6 75 09/05/2025
6.0.0-preview.1.21102.12 80 09/05/2025
5.0.0 72 09/05/2025
5.0.0-rc.2.20475.5 74 09/05/2025
5.0.0-rc.1.20451.14 77 09/05/2025
5.0.0-preview.8.20407.11 84 09/05/2025
5.0.0-preview.7.20364.11 73 09/05/2025
5.0.0-preview.6.20305.6 79 09/05/2025
5.0.0-preview.5.20278.1 78 09/05/2025
5.0.0-preview.4.20251.6 79 09/05/2025
5.0.0-preview.3.20215.2 76 09/05/2025
5.0.0-preview.2.20160.3 80 09/05/2025
5.0.0-preview.1.20120.4 80 09/05/2025
3.1.32 68 09/05/2025
3.1.31 69 09/05/2025
3.1.30 64 09/05/2025
3.1.29 70 09/05/2025
3.1.28 65 09/05/2025
3.1.27 66 09/05/2025
3.1.26 64 09/05/2025
3.1.25 66 09/05/2025
3.1.24 67 09/05/2025
3.1.23 68 09/05/2025
3.1.22 69 09/05/2025
3.1.21 70 09/05/2025
3.1.20 72 09/05/2025
3.1.19 69 09/05/2025
3.1.18 68 09/05/2025
3.1.17 67 09/05/2025
3.1.16 65 09/05/2025
3.1.15 68 09/05/2025
3.1.14 72 09/05/2025
3.1.13 73 09/05/2025
3.1.12 72 09/05/2025
3.1.11 66 09/05/2025
3.1.10 67 09/05/2025
3.1.9 70 09/05/2025
3.1.8 66 09/05/2025
3.1.7 65 09/05/2025
3.1.6 70 09/05/2025
3.1.5 69 09/05/2025
3.1.4 67 09/05/2025
3.1.3 69 09/05/2025
3.1.2 65 09/05/2025
3.1.1 69 09/05/2025
3.1.0 64 09/05/2025
3.1.0-preview3.19553.2 74 09/05/2025
3.1.0-preview2.19525.4 75 09/05/2025
3.1.0-preview1.19506.1 76 09/05/2025
3.0.3 66 09/05/2025
3.0.2 67 09/05/2025
3.0.1 65 09/05/2025
3.0.0 74 09/05/2025
3.0.0-rc1.19456.10 69 09/05/2025
3.0.0-preview9.19423.4 70 09/05/2025
3.0.0-preview8.19405.4 68 09/05/2025
3.0.0-preview7.19362.4 73 09/05/2025
3.0.0-preview6.19304.6 69 09/05/2025
3.0.0-preview5.19227.9 71 09/05/2025
3.0.0-preview4.19216.2 72 09/05/2025
3.0.0-preview3.19153.1 72 09/05/2025
3.0.0-preview.19074.2 72 09/05/2025
3.0.0-preview.18572.1 72 09/05/2025
2.2.0 73 09/05/2025
2.2.0-preview3-35497 66 09/05/2025
2.2.0-preview2-35157 71 09/05/2025
2.2.0-preview1-35029 71 09/05/2025
2.1.1 68 09/05/2025
2.1.0 66 09/05/2025
2.1.0-rc1-final 73 09/05/2025
2.1.0-preview2-final 68 09/05/2025
2.1.0-preview1-final 68 09/05/2025
2.0.2 68 09/05/2025
2.0.1 64 09/05/2025
2.0.0 65 09/05/2025
2.0.0-preview2-final 72 09/05/2025
2.0.0-preview1-final 66 09/05/2025
1.1.2 71 09/05/2025
1.1.1 65 09/05/2025
1.1.0 66 09/05/2025
1.1.0-preview1-final 72 09/05/2025
1.0.2 66 09/05/2025
1.0.1 67 09/05/2025
1.0.0 69 09/05/2025
1.0.0-rc2-final 67 09/05/2025
1.0.0-rc1-final 66 09/05/2025