Microsoft.Extensions.Configuration.CommandLine 9.0.7

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
Hosting and startup infrastructures for applications.
2,007
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
1,973
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
72
Microsoft.AspNetCore
Microsoft.AspNetCore
69
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
68
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
67
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications. When using NuGet 3.x this package requires at least version 3.4.
65
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
64
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
63
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
62
Microsoft.AspNetCore
Microsoft.AspNetCore
59
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
59
Microsoft.AspNetCore
Microsoft.AspNetCore
58
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
58
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications. When using NuGet 3.x this package requires at least version 3.4.
58
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
58
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications. When using NuGet 3.x this package requires at least version 3.4.
57

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

Version Downloads Last updated
10.0.0-preview.6.25358.103 6 07/15/2025
10.0.0-preview.5.25277.114 7 06/14/2025
10.0.0-preview.4.25258.110 12 05/16/2025
10.0.0-preview.3.25171.5 14 04/13/2025
10.0.0-preview.2.25163.2 17 03/23/2025
10.0.0-preview.1.25080.5 18 02/27/2025
9.0.8 3 08/05/2025
9.0.7 3 07/15/2025
9.0.6 7 06/12/2025
9.0.5 12 05/16/2025
9.0.4 17 04/10/2025
9.0.3 15 03/12/2025
9.0.2 17 02/13/2025
9.0.1 23 01/18/2025
9.0.0 32 11/13/2024
9.0.0-rc.2.24473.5 26 10/09/2024
9.0.0-rc.1.24431.7 30 09/13/2024
9.0.0-preview.7.24405.7 28 08/14/2024
9.0.0-preview.6.24327.7 36 07/25/2024
9.0.0-preview.5.24306.7 39 06/15/2024
9.0.0-preview.4.24266.19 31 05/24/2024
9.0.0-preview.3.24172.9 36 04/12/2024
9.0.0-preview.2.24128.5 39 03/24/2024
9.0.0-preview.1.24080.9 42 03/11/2024
8.0.0 1,972 11/16/2023
8.0.0-rc.2.23479.6 47 10/21/2023
8.0.0-rc.1.23419.4 46 09/19/2023
8.0.0-preview.7.23375.6 37 08/17/2023
8.0.0-preview.6.23329.7 51 07/18/2023
8.0.0-preview.5.23280.8 54 07/21/2023
8.0.0-preview.4.23259.5 42 06/28/2023
8.0.0-preview.3.23174.8 53 07/11/2023
8.0.0-preview.2.23128.3 42 07/12/2023
8.0.0-preview.1.23110.8 39 07/12/2023
7.0.0 56 11/30/2022
7.0.0-rc.2.22472.3 42 07/11/2023
7.0.0-rc.1.22426.10 53 09/29/2022
7.0.0-preview.7.22375.6 47 07/09/2023
7.0.0-preview.6.22324.4 47 07/28/2022
7.0.0-preview.5.22301.12 43 07/04/2023
7.0.0-preview.4.22229.4 43 07/07/2023
7.0.0-preview.3.22175.4 46 07/11/2023
7.0.0-preview.2.22152.2 45 02/17/2023
7.0.0-preview.1.22076.8 61 03/06/2022
6.0.2-mauipre.1.22102.15 52 07/17/2023
6.0.2-mauipre.1.22054.8 46 04/07/2023
6.0.1 27 11/13/2024
6.0.0 1,996 12/15/2021
6.0.0-rc.2.21480.5 52 07/01/2023
6.0.0-rc.1.21451.13 43 07/02/2023
6.0.0-preview.7.21377.19 55 09/14/2022
6.0.0-preview.6.21352.12 52 11/09/2022
6.0.0-preview.5.21301.5 49 06/18/2023
6.0.0-preview.4.21253.7 51 07/07/2023
6.0.0-preview.3.21201.4 53 05/01/2023
6.0.0-preview.2.21154.6 44 12/25/2021
6.0.0-preview.1.21102.12 47 06/29/2023
5.0.0 50 10/02/2022
5.0.0-rc.2.20475.5 39 07/10/2023
5.0.0-rc.1.20451.14 39 06/06/2023
5.0.0-preview.8.20407.11 51 07/14/2023
5.0.0-preview.7.20364.11 42 07/11/2023
5.0.0-preview.6.20305.6 49 07/08/2023
5.0.0-preview.5.20278.1 49 07/09/2023
5.0.0-preview.4.20251.6 55 07/12/2023
5.0.0-preview.3.20215.2 49 10/17/2022
5.0.0-preview.2.20160.3 54 05/14/2023
5.0.0-preview.1.20120.4 50 07/06/2023
3.1.32 43 05/17/2023
3.1.31 39 05/19/2023
3.1.30 49 04/08/2023
3.1.29 40 07/14/2023
3.1.28 41 04/05/2023
3.1.27 41 05/19/2023
3.1.26 53 05/14/2023
3.1.25 39 05/26/2023
3.1.24 40 08/12/2022
3.1.23 42 07/11/2023
3.1.22 38 07/09/2023
3.1.21 41 07/12/2023
3.1.20 41 05/25/2023
3.1.19 43 10/21/2022
3.1.18 46 07/06/2023
3.1.17 39 05/15/2023
3.1.16 39 07/14/2023
3.1.15 41 04/15/2023
3.1.14 58 05/14/2023
3.1.13 45 12/15/2021
3.1.12 52 07/08/2023
3.1.11 41 06/11/2022
3.1.10 46 12/15/2021
3.1.9 47 05/16/2023
3.1.8 56 05/17/2023
3.1.7 51 05/14/2023
3.1.6 42 05/15/2023
3.1.5 48 11/20/2022
3.1.4 47 04/05/2023
3.1.3 42 07/15/2022
3.1.2 46 07/07/2023
3.1.1 47 06/19/2022
3.1.0 41 12/15/2021
3.1.0-preview3.19553.2 37 07/10/2023
3.1.0-preview2.19525.4 40 07/21/2023
3.1.0-preview1.19506.1 44 12/20/2021
3.0.3 42 12/15/2021
3.0.2 52 02/10/2023
3.0.1 49 04/06/2023
3.0.0 42 07/15/2022
3.0.0-rc1.19456.10 48 06/16/2022
3.0.0-preview9.19423.4 43 07/10/2023
3.0.0-preview8.19405.4 39 08/28/2022
3.0.0-preview7.19362.4 46 11/16/2022
3.0.0-preview6.19304.6 49 07/04/2023
3.0.0-preview5.19227.9 56 07/11/2023
3.0.0-preview4.19216.2 57 07/09/2023
3.0.0-preview3.19153.1 64 07/07/2023
3.0.0-preview.19074.2 54 06/17/2023
3.0.0-preview.18572.1 54 07/12/2023
2.2.0 52 05/08/2023
2.2.0-preview3-35497 53 04/30/2022
2.2.0-preview2-35157 54 05/04/2023
2.2.0-preview1-35029 44 02/02/2023
2.1.1 55 09/14/2022
2.1.0 52 02/16/2023
2.1.0-rc1-final 63 09/18/2022
2.1.0-preview2-final 40 02/16/2023
2.1.0-preview1-final 41 04/26/2023
2.0.2 45 10/05/2022
2.0.1 46 04/15/2023
2.0.0 43 06/07/2022
2.0.0-preview2-final 57 10/16/2022
2.0.0-preview1-final 46 05/09/2023
1.1.2 47 04/09/2023
1.1.1 38 05/24/2023
1.1.0 43 12/20/2022
1.1.0-preview1-final 52 05/17/2023
1.0.2 44 06/11/2023
1.0.1 48 05/09/2023
1.0.0 42 05/17/2023
1.0.0-rc2-final 47 04/11/2023
1.0.0-rc1-final 48 12/24/2021