Microsoft.Extensions.Configuration.CommandLine 9.0.17

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
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
160
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
147
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
145
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
141
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
131
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
130
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
125
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
119
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
112
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
37
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
36
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
34
Volo.Abp.Core
Package Description
33
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
33
Volo.Abp.Core
Package Description
32
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
32

Version Downloads Last updated
11.0.0-preview.5.26302.115 5 6/10/2026
11.0.0-preview.4.26230.115 10 5/13/2026
11.0.0-preview.3.26207.106 13 5/3/2026
11.0.0-preview.2.26159.112 14 3/12/2026
11.0.0-preview.1.26104.118 19 2/12/2026
10.0.9 4 6/10/2026
10.0.8 10 5/13/2026
10.0.7 12 5/4/2026
10.0.6 12 5/3/2026
10.0.5 15 3/14/2026
10.0.4 13 3/12/2026
10.0.3 16 2/12/2026
10.0.2 20 1/15/2026
10.0.1 23 12/10/2025
10.0.0 56 11/13/2025
10.0.0-rc.2.25502.107 60 10/14/2025
10.0.0-rc.1.25451.107 76 9/10/2025
10.0.0-preview.7.25380.108 68 8/13/2025
10.0.0-preview.6.25358.103 67 7/16/2025
10.0.0-preview.5.25277.114 64 6/8/2025
10.0.0-preview.4.25258.110 90 5/15/2025
10.0.0-preview.3.25171.5 82 4/11/2025
10.0.0-preview.2.25163.2 80 3/20/2025
10.0.0-preview.1.25080.5 77 2/26/2025
9.0.17 4 6/10/2026
9.0.16 11 5/13/2026
9.0.15 13 5/3/2026
9.0.14 15 3/12/2026
9.0.13 15 2/12/2026
9.0.12 21 1/16/2026
9.0.11 42 11/13/2025
9.0.10 59 10/14/2025
9.0.9 60 9/10/2025
9.0.8 69 8/5/2025
9.0.7 76 7/12/2025
9.0.6 64 6/12/2025
9.0.5 88 5/16/2025
9.0.4 86 4/9/2025
9.0.3 86 3/13/2025
9.0.2 90 2/12/2025
9.0.1 105 1/18/2025
9.0.0 103 11/15/2024
9.0.0-rc.2.24473.5 89 10/15/2024
9.0.0-rc.1.24431.7 105 9/11/2024
9.0.0-preview.7.24405.7 130 8/15/2024
9.0.0-preview.6.24327.7 123 7/10/2024
9.0.0-preview.5.24306.7 109 6/14/2024
9.0.0-preview.4.24266.19 112 5/24/2024
9.0.0-preview.3.24172.9 124 4/16/2024
9.0.0-preview.2.24128.5 123 3/29/2024
9.0.0-preview.1.24080.9 126 2/19/2024
8.0.0 129 11/16/2023
8.0.0-rc.2.23479.6 130 10/24/2023
8.0.0-rc.1.23419.4 137 9/17/2023
8.0.0-preview.7.23375.6 137 8/23/2023
8.0.0-preview.6.23329.7 136 7/22/2023
8.0.0-preview.5.23280.8 137 8/3/2023
8.0.0-preview.4.23259.5 134 8/3/2023
8.0.0-preview.3.23174.8 132 5/14/2023
8.0.0-preview.2.23128.3 124 5/17/2023
8.0.0-preview.1.23110.8 117 2/24/2023
7.0.0 121 12/5/2022
7.0.0-rc.2.22472.3 121 12/5/2022
7.0.0-rc.1.22426.10 148 9/16/2022
7.0.0-preview.7.22375.6 127 8/16/2022
7.0.0-preview.6.22324.4 127 9/16/2022
7.0.0-preview.5.22301.12 126 6/29/2022
7.0.0-preview.4.22229.4 136 6/29/2022
7.0.0-preview.3.22175.4 128 6/29/2022
7.0.0-preview.2.22152.2 143 6/29/2022
7.0.0-preview.1.22076.8 140 6/29/2022
6.0.2-mauipre.1.22102.15 149 6/29/2022
6.0.2-mauipre.1.22054.8 140 6/29/2022
6.0.1 108 11/18/2024
6.0.0 134 6/29/2022
6.0.0-rc.2.21480.5 145 6/29/2022
6.0.0-rc.1.21451.13 134 6/29/2022
6.0.0-preview.7.21377.19 123 8/29/2022
6.0.0-preview.6.21352.12 136 10/6/2022
6.0.0-preview.5.21301.5 145 10/10/2022
6.0.0-preview.4.21253.7 126 9/26/2022
6.0.0-preview.3.21201.4 118 10/23/2022
6.0.0-preview.2.21154.6 140 9/13/2022
6.0.0-preview.1.21102.12 121 2/14/2023
5.0.0 127 2/22/2023
5.0.0-rc.2.20475.5 136 12/19/2022
5.0.0-rc.1.20451.14 127 7/31/2022
5.0.0-preview.8.20407.11 137 1/27/2023
5.0.0-preview.7.20364.11 136 9/2/2022
5.0.0-preview.6.20305.6 136 9/22/2022
5.0.0-preview.5.20278.1 111 2/5/2023
5.0.0-preview.4.20251.6 127 10/9/2022
5.0.0-preview.3.20215.2 131 2/24/2023
5.0.0-preview.2.20160.3 122 10/17/2022
5.0.0-preview.1.20120.4 151 10/17/2022
3.1.32 140 1/27/2023
3.1.31 138 11/23/2022
3.1.30 123 10/23/2022
3.1.29 123 9/16/2022
3.1.28 120 9/16/2022
3.1.27 143 9/16/2022
3.1.26 120 2/24/2023
3.1.25 136 9/26/2022
3.1.24 103 1/4/2023
3.1.23 117 2/24/2023
3.1.22 114 7/26/2022
3.1.21 145 6/29/2022
3.1.20 143 6/29/2022
3.1.19 138 6/29/2022
3.1.18 131 6/29/2022
3.1.17 131 6/29/2022
3.1.16 132 6/29/2022
3.1.15 131 6/29/2022
3.1.14 123 6/29/2022
3.1.13 119 6/29/2022
3.1.12 131 6/29/2022
3.1.11 132 6/29/2022
3.1.10 126 6/29/2022
3.1.9 127 10/16/2022
3.1.8 122 9/2/2022
3.1.7 140 8/31/2022
3.1.6 125 8/12/2022
3.1.5 131 10/18/2022
3.1.4 132 2/24/2023
3.1.3 143 11/29/2022
3.1.2 129 6/29/2022
3.1.1 140 6/29/2022
3.1.0 127 6/29/2022
3.1.0-preview3.19553.2 118 6/29/2022
3.1.0-preview2.19525.4 117 6/29/2022
3.1.0-preview1.19506.1 128 6/29/2022
3.0.3 126 6/29/2022
3.0.2 124 6/29/2022
3.0.1 118 6/29/2022
3.0.0 131 6/29/2022
3.0.0-rc1.19456.10 136 6/29/2022
3.0.0-preview9.19423.4 109 6/29/2022
3.0.0-preview8.19405.4 125 6/29/2022
3.0.0-preview7.19362.4 125 6/29/2022
3.0.0-preview6.19304.6 115 6/29/2022
3.0.0-preview5.19227.9 131 6/29/2022
3.0.0-preview4.19216.2 129 6/29/2022
3.0.0-preview3.19153.1 128 6/29/2022
3.0.0-preview.19074.2 121 6/29/2022
3.0.0-preview.18572.1 127 6/29/2022
2.2.0 135 6/29/2022
2.2.0-preview3-35497 119 6/29/2022
2.2.0-preview2-35157 148 6/29/2022
2.2.0-preview1-35029 124 6/29/2022
2.1.1 119 6/29/2022
2.1.0 135 6/29/2022
2.1.0-rc1-final 135 6/29/2022
2.1.0-preview2-final 142 6/29/2022
2.1.0-preview1-final 129 6/29/2022
2.0.2 142 6/29/2022
2.0.1 125 6/29/2022
2.0.0 112 6/29/2022
2.0.0-preview2-final 118 6/29/2022
2.0.0-preview1-final 138 6/29/2022
1.1.2 154 6/29/2022
1.1.1 128 6/29/2022
1.1.0 131 6/29/2022
1.1.0-preview1-final 127 6/29/2022
1.0.2 146 6/29/2022
1.0.1 133 6/29/2022
1.0.0 131 6/29/2022
1.0.0-rc2-final 124 6/29/2022
1.0.0-rc1-final 120 6/29/2022