Microsoft.Extensions.Configuration.CommandLine 10.0.0-preview.6.25358.103

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
28
Microsoft.AspNetCore
Microsoft.AspNetCore
29
Microsoft.AspNetCore
Microsoft.AspNetCore
30
Microsoft.AspNetCore
Microsoft.AspNetCore
31
Microsoft.AspNetCore
Microsoft.AspNetCore
33
Microsoft.AspNetCore
Microsoft.AspNetCore
36
Microsoft.AspNetCore
Microsoft.AspNetCore
38
Microsoft.AspNetCore.App
Provides a default set of APIs for building an ASP.NET Core application. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.
28
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
34
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
35
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
38
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
59
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
30
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
55

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

.NET Framework 4.6.2

.NET 8.0

.NET 9.0

.NET 10.0

.NET Standard 2.0

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