Microsoft.Extensions.Configuration.CommandLine 9.0.0

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.
47
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
42
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
39
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
35
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
34
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
33
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
32

Version Downloads Last updated
9.0.0 1 11/15/2024
9.0.0-rc.2.24473.5 8 10/15/2024
9.0.0-rc.1.24431.7 10 9/11/2024
9.0.0-preview.7.24405.7 15 8/15/2024
9.0.0-preview.6.24327.7 18 7/10/2024
9.0.0-preview.5.24306.7 14 6/14/2024
9.0.0-preview.4.24266.19 16 5/24/2024
9.0.0-preview.3.24172.9 18 4/16/2024
9.0.0-preview.2.24128.5 18 3/29/2024
9.0.0-preview.1.24080.9 24 2/19/2024
8.0.0 28 11/16/2023
8.0.0-rc.2.23479.6 26 10/24/2023
8.0.0-rc.1.23419.4 26 9/17/2023
8.0.0-preview.7.23375.6 36 8/23/2023
8.0.0-preview.6.23329.7 36 7/22/2023
8.0.0-preview.5.23280.8 34 8/3/2023
8.0.0-preview.4.23259.5 38 8/3/2023
8.0.0-preview.3.23174.8 35 5/14/2023
8.0.0-preview.2.23128.3 38 5/17/2023
8.0.0-preview.1.23110.8 28 2/24/2023
7.0.0 35 12/5/2022
7.0.0-rc.2.22472.3 30 12/5/2022
7.0.0-rc.1.22426.10 40 9/16/2022
7.0.0-preview.7.22375.6 35 8/16/2022
7.0.0-preview.6.22324.4 37 9/16/2022
7.0.0-preview.5.22301.12 36 6/29/2022
7.0.0-preview.4.22229.4 40 6/29/2022
7.0.0-preview.3.22175.4 29 6/29/2022
7.0.0-preview.2.22152.2 41 6/29/2022
7.0.0-preview.1.22076.8 39 6/29/2022
6.0.2-mauipre.1.22102.15 43 6/29/2022
6.0.2-mauipre.1.22054.8 42 6/29/2022
6.0.1 1 11/18/2024
6.0.0 41 6/29/2022
6.0.0-rc.2.21480.5 36 6/29/2022
6.0.0-rc.1.21451.13 33 6/29/2022
6.0.0-preview.7.21377.19 37 8/29/2022
6.0.0-preview.6.21352.12 35 10/6/2022
6.0.0-preview.5.21301.5 38 10/10/2022
6.0.0-preview.4.21253.7 32 9/26/2022
6.0.0-preview.3.21201.4 32 10/23/2022
6.0.0-preview.2.21154.6 35 9/13/2022
6.0.0-preview.1.21102.12 34 2/14/2023
5.0.0 35 2/22/2023
5.0.0-rc.2.20475.5 36 12/19/2022
5.0.0-rc.1.20451.14 32 7/31/2022
5.0.0-preview.8.20407.11 38 1/27/2023
5.0.0-preview.7.20364.11 36 9/2/2022
5.0.0-preview.6.20305.6 35 9/22/2022
5.0.0-preview.5.20278.1 30 2/5/2023
5.0.0-preview.4.20251.6 41 10/9/2022
5.0.0-preview.3.20215.2 37 2/24/2023
5.0.0-preview.2.20160.3 28 10/17/2022
5.0.0-preview.1.20120.4 44 10/17/2022
3.1.32 36 1/27/2023
3.1.31 38 11/23/2022
3.1.30 39 10/23/2022
3.1.29 31 9/16/2022
3.1.28 34 9/16/2022
3.1.27 43 9/16/2022
3.1.26 28 2/24/2023
3.1.25 42 9/26/2022
3.1.24 33 1/4/2023
3.1.23 34 2/24/2023
3.1.22 32 7/26/2022
3.1.21 36 6/29/2022
3.1.20 45 6/29/2022
3.1.19 42 6/29/2022
3.1.18 33 6/29/2022
3.1.17 35 6/29/2022
3.1.16 32 6/29/2022
3.1.15 39 6/29/2022
3.1.14 33 6/29/2022
3.1.13 32 6/29/2022
3.1.12 37 6/29/2022
3.1.11 41 6/29/2022
3.1.10 33 6/29/2022
3.1.9 35 10/16/2022
3.1.8 34 9/2/2022
3.1.7 37 8/31/2022
3.1.6 36 8/12/2022
3.1.5 40 10/18/2022
3.1.4 31 2/24/2023
3.1.3 33 11/29/2022
3.1.2 35 6/29/2022
3.1.1 40 6/29/2022
3.1.0 37 6/29/2022
3.1.0-preview3.19553.2 34 6/29/2022
3.1.0-preview2.19525.4 33 6/29/2022
3.1.0-preview1.19506.1 44 6/29/2022
3.0.3 45 6/29/2022
3.0.2 33 6/29/2022
3.0.1 36 6/29/2022
3.0.0 36 6/29/2022
3.0.0-rc1.19456.10 45 6/29/2022
3.0.0-preview9.19423.4 33 6/29/2022
3.0.0-preview8.19405.4 34 6/29/2022
3.0.0-preview7.19362.4 36 6/29/2022
3.0.0-preview6.19304.6 36 6/29/2022
3.0.0-preview5.19227.9 34 6/29/2022
3.0.0-preview4.19216.2 35 6/29/2022
3.0.0-preview3.19153.1 30 6/29/2022
3.0.0-preview.19074.2 42 6/29/2022
3.0.0-preview.18572.1 37 6/29/2022
2.2.0 37 6/29/2022
2.2.0-preview3-35497 34 6/29/2022
2.2.0-preview2-35157 48 6/29/2022
2.2.0-preview1-35029 35 6/29/2022
2.1.1 33 6/29/2022
2.1.0 45 6/29/2022
2.1.0-rc1-final 52 6/29/2022
2.1.0-preview2-final 41 6/29/2022
2.1.0-preview1-final 34 6/29/2022
2.0.2 34 6/29/2022
2.0.1 38 6/29/2022
2.0.0 41 6/29/2022
2.0.0-preview2-final 35 6/29/2022
2.0.0-preview1-final 38 6/29/2022
1.1.2 46 6/29/2022
1.1.1 43 6/29/2022
1.1.0 37 6/29/2022
1.1.0-preview1-final 32 6/29/2022
1.0.2 44 6/29/2022
1.0.1 42 6/29/2022
1.0.0 42 6/29/2022
1.0.0-rc2-final 35 6/29/2022
1.0.0-rc1-final 36 6/29/2022