Microsoft.Extensions.Configuration.CommandLine 8.0.0-rc.2.23479.6

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.
1,449
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
1,419
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
64
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
60
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
58
Microsoft.AspNetCore
Microsoft.AspNetCore
56
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
56
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications. When using NuGet 3.x this package requires at least version 3.4.
55
Microsoft.AspNetCore
Microsoft.AspNetCore
54
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
53
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
52
Microsoft.AspNetCore
Microsoft.AspNetCore
50
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
50
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
49
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
47
Microsoft.AspNetCore.All
Provides a default set of APIs for building an ASP.NET Core application, and also includes API for third-party integrations with ASP.NET Core. 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.
47
Microsoft.AspNetCore
Microsoft.AspNetCore
47

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

.NET Framework 4.6.2

.NET 6.0

.NET 7.0

.NET 8.0

.NET Standard 2.0

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