Microsoft.Extensions.Configuration.CommandLine 9.0.10

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,642
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
2,619
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
82
Microsoft.AspNetCore
Microsoft.AspNetCore
77
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
76
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
74
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications. When using NuGet 3.x this package requires at least version 3.4.
73
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
73
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
71
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
70
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.
66
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications. When using NuGet 3.x this package requires at least version 3.4.
66
Microsoft.AspNetCore
Microsoft.AspNetCore
65
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
65

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

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