Microsoft.Extensions.Configuration.CommandLine 10.0.0-preview.3.25171.5

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
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
88
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
75
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
72
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
69
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
64
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
63
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
57
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
55
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
53

.NET Framework 4.6.2

.NET 8.0

.NET 9.0

.NET 10.0

.NET Standard 2.0

Version Downloads Last updated
10.0.0-preview.3.25171.5 11 4/11/2025
10.0.0-preview.2.25163.2 13 3/20/2025
10.0.0-preview.1.25080.5 13 2/26/2025
9.0.4 9 4/9/2025
9.0.3 14 3/13/2025
9.0.2 23 2/12/2025
9.0.1 31 1/18/2025
9.0.0 25 11/15/2024
9.0.0-rc.2.24473.5 22 10/15/2024
9.0.0-rc.1.24431.7 34 9/11/2024
9.0.0-preview.7.24405.7 40 8/15/2024
9.0.0-preview.6.24327.7 41 7/10/2024
9.0.0-preview.5.24306.7 41 6/14/2024
9.0.0-preview.4.24266.19 41 5/24/2024
9.0.0-preview.3.24172.9 40 4/16/2024
9.0.0-preview.2.24128.5 41 3/29/2024
9.0.0-preview.1.24080.9 47 2/19/2024
8.0.0 53 11/16/2023
8.0.0-rc.2.23479.6 55 10/24/2023
8.0.0-rc.1.23419.4 51 9/17/2023
8.0.0-preview.7.23375.6 67 8/23/2023
8.0.0-preview.6.23329.7 64 7/22/2023
8.0.0-preview.5.23280.8 63 8/3/2023
8.0.0-preview.4.23259.5 66 8/3/2023
8.0.0-preview.3.23174.8 59 5/14/2023
8.0.0-preview.2.23128.3 55 5/17/2023
8.0.0-preview.1.23110.8 49 2/24/2023
7.0.0 58 12/5/2022
7.0.0-rc.2.22472.3 51 12/5/2022
7.0.0-rc.1.22426.10 67 9/16/2022
7.0.0-preview.7.22375.6 63 8/16/2022
7.0.0-preview.6.22324.4 62 9/16/2022
7.0.0-preview.5.22301.12 62 6/29/2022
7.0.0-preview.4.22229.4 69 6/29/2022
7.0.0-preview.3.22175.4 53 6/29/2022
7.0.0-preview.2.22152.2 68 6/29/2022
7.0.0-preview.1.22076.8 67 6/29/2022
6.0.2-mauipre.1.22102.15 71 6/29/2022
6.0.2-mauipre.1.22054.8 70 6/29/2022
6.0.1 33 11/18/2024
6.0.0 63 6/29/2022
6.0.0-rc.2.21480.5 68 6/29/2022
6.0.0-rc.1.21451.13 56 6/29/2022
6.0.0-preview.7.21377.19 64 8/29/2022
6.0.0-preview.6.21352.12 57 10/6/2022
6.0.0-preview.5.21301.5 70 10/10/2022
6.0.0-preview.4.21253.7 53 9/26/2022
6.0.0-preview.3.21201.4 45 10/23/2022
6.0.0-preview.2.21154.6 65 9/13/2022
6.0.0-preview.1.21102.12 56 2/14/2023
5.0.0 56 2/22/2023
5.0.0-rc.2.20475.5 63 12/19/2022
5.0.0-rc.1.20451.14 58 7/31/2022
5.0.0-preview.8.20407.11 69 1/27/2023
5.0.0-preview.7.20364.11 68 9/2/2022
5.0.0-preview.6.20305.6 63 9/22/2022
5.0.0-preview.5.20278.1 44 2/5/2023
5.0.0-preview.4.20251.6 57 10/9/2022
5.0.0-preview.3.20215.2 64 2/24/2023
5.0.0-preview.2.20160.3 51 10/17/2022
5.0.0-preview.1.20120.4 71 10/17/2022
3.1.32 64 1/27/2023
3.1.31 68 11/23/2022
3.1.30 60 10/23/2022
3.1.29 57 9/16/2022
3.1.28 59 9/16/2022
3.1.27 67 9/16/2022
3.1.26 51 2/24/2023
3.1.25 62 9/26/2022
3.1.24 43 1/4/2023
3.1.23 56 2/24/2023
3.1.22 53 7/26/2022
3.1.21 60 6/29/2022
3.1.20 72 6/29/2022
3.1.19 64 6/29/2022
3.1.18 58 6/29/2022
3.1.17 56 6/29/2022
3.1.16 58 6/29/2022
3.1.15 63 6/29/2022
3.1.14 58 6/29/2022
3.1.13 55 6/29/2022
3.1.12 62 6/29/2022
3.1.11 66 6/29/2022
3.1.10 58 6/29/2022
3.1.9 61 10/16/2022
3.1.8 57 9/2/2022
3.1.7 58 8/31/2022
3.1.6 59 8/12/2022
3.1.5 59 10/18/2022
3.1.4 58 2/24/2023
3.1.3 58 11/29/2022
3.1.2 60 6/29/2022
3.1.1 64 6/29/2022
3.1.0 63 6/29/2022
3.1.0-preview3.19553.2 58 6/29/2022
3.1.0-preview2.19525.4 58 6/29/2022
3.1.0-preview1.19506.1 62 6/29/2022
3.0.3 59 6/29/2022
3.0.2 55 6/29/2022
3.0.1 58 6/29/2022
3.0.0 60 6/29/2022
3.0.0-rc1.19456.10 72 6/29/2022
3.0.0-preview9.19423.4 48 6/29/2022
3.0.0-preview8.19405.4 59 6/29/2022
3.0.0-preview7.19362.4 59 6/29/2022
3.0.0-preview6.19304.6 51 6/29/2022
3.0.0-preview5.19227.9 58 6/29/2022
3.0.0-preview4.19216.2 62 6/29/2022
3.0.0-preview3.19153.1 56 6/29/2022
3.0.0-preview.19074.2 60 6/29/2022
3.0.0-preview.18572.1 55 6/29/2022
2.2.0 60 6/29/2022
2.2.0-preview3-35497 55 6/29/2022
2.2.0-preview2-35157 77 6/29/2022
2.2.0-preview1-35029 57 6/29/2022
2.1.1 45 6/29/2022
2.1.0 68 6/29/2022
2.1.0-rc1-final 69 6/29/2022
2.1.0-preview2-final 71 6/29/2022
2.1.0-preview1-final 58 6/29/2022
2.0.2 59 6/29/2022
2.0.1 57 6/29/2022
2.0.0 55 6/29/2022
2.0.0-preview2-final 54 6/29/2022
2.0.0-preview1-final 61 6/29/2022
1.1.2 72 6/29/2022
1.1.1 63 6/29/2022
1.1.0 63 6/29/2022
1.1.0-preview1-final 59 6/29/2022
1.0.2 66 6/29/2022
1.0.1 65 6/29/2022
1.0.0 67 6/29/2022
1.0.0-rc2-final 57 6/29/2022
1.0.0-rc1-final 55 6/29/2022