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
Microsoft.AspNetCore
Microsoft.AspNetCore
312
Microsoft.AspNetCore
Microsoft.AspNetCore
48
Microsoft.AspNetCore
Microsoft.AspNetCore
44
Microsoft.AspNetCore
Microsoft.AspNetCore
43
Microsoft.AspNetCore
Microsoft.AspNetCore
41
Microsoft.AspNetCore
Microsoft.AspNetCore
39
Microsoft.AspNetCore
Microsoft.AspNetCore
38
Microsoft.AspNetCore
Microsoft.AspNetCore
37
Microsoft.AspNetCore
Microsoft.AspNetCore
36
Microsoft.AspNetCore
Microsoft.AspNetCore
35
Microsoft.AspNetCore
Microsoft.AspNetCore
34
Microsoft.AspNetCore
Microsoft.AspNetCore
32
Microsoft.AspNetCore
Microsoft.AspNetCore
30
Microsoft.AspNetCore
Microsoft.AspNetCore
29
Microsoft.AspNetCore
Microsoft.AspNetCore
28

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

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