Microsoft.Extensions.Configuration.CommandLine 9.0.9

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,269
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
2,240
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
78
Microsoft.AspNetCore
Microsoft.AspNetCore
73
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
73
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
72
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.
70
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
67
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
66
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
64
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
63
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications. When using NuGet 3.x this package requires at least version 3.4.
63
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
63
Microsoft.AspNetCore
Microsoft.AspNetCore
62
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications. When using NuGet 3.x this package requires at least version 3.4.
62

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

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