Microsoft.Extensions.Configuration.CommandLine 9.0.0
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 |
---|---|
Honeycomb.OpenTelemetry
Honeycomb's OpenTelemetry SDK
|
12 |
Microsoft.AspNetCore
Microsoft.AspNetCore
|
14 |
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.
|
12 |
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.
|
13 |
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.
|
14 |
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.
|
12 |
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.
|
13 |
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
|
12 |
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
|
13 |
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
|
19 |
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
|
22 |
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
|
145 |
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
|
17 |
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
|
5,333 |
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
|
8,819 |
.NET Framework 4.6.2
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Configuration (>= 9.0.0)
.NET 8.0
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Configuration (>= 9.0.0)
.NET 9.0
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Configuration (>= 9.0.0)
.NET Standard 2.0
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Configuration (>= 9.0.0)