Devlead.Console 2025.11.25.507

Prefix Reserved
dotnet add package Devlead.Console --version 2025.11.25.507
                    
NuGet\Install-Package Devlead.Console -Version 2025.11.25.507
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Devlead.Console" Version="2025.11.25.507" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Devlead.Console" Version="2025.11.25.507" />
                    
Directory.Packages.props
<PackageReference Include="Devlead.Console" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Devlead.Console --version 2025.11.25.507
                    
#r "nuget: Devlead.Console, 2025.11.25.507"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Devlead.Console@2025.11.25.507
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Devlead.Console&version=2025.11.25.507
                    
Install as a Cake Addin
#tool nuget:?package=Devlead.Console&version=2025.11.25.507
                    
Install as a Cake Tool

Devlead.Console

Devlead.Console is a streamlined NuGet source package designed to accelerate the development of .NET console applications. By providing out-of-the-box configurations for Inversion of Control (IoC), command-line parsing, logging, and other essential utilities, Devlead.Console allows developers to focus on building business logic rather than setting up foundational components.

Features

  • Dependency injection / IoC container via Microsoft.Extensions
  • Command-line parsing via Spectre.Console
  • Logging via Microsoft.Extensions.Logging.Console
  • Configuration via Microsoft.Extensions.Configuration
  • Source-link for GitHub (or Azure Repos by setting MSBuild property AzureRepos to true)
  • ...

Installation

dotnet add package Devlead.Console

Usage Example

Here's how to create a console application using Devlead.Console, which comes with sensible defaults to streamline your setup. Additionally, you can utilize optional partial methods to tailor the project to your specific needs:

public partial class Program
{
    // Configure in-memory settings (useful for development/testing)
    static partial void ConfigureInMemory(IDictionary<string, string?> configData)
    {
        configData.Add("TestService__Version", "1.0.0.0");
    }

    // Register your services
    static partial void AddServices(IServiceCollection services)
    {
        services
            .AddOptions<TestServiceSettings>()
            .BindConfiguration(nameof(TestService));

        services.AddSingleton<TestService>();
    }

    // Configure commands
    static partial void ConfigureApp(AppServiceConfig appServiceConfig)
    {
        // Example: Add a root level command
        appServiceConfig
            .AddCommand<TestCommand>("test")
                .WithDescription("Example test command.")
                .WithExample(["test"]);

        // Example: Add nested commands using branches
        appServiceConfig
            .AddBranch(
                "yolo",
                c => c.AddCommand<TestCommand>("test")
                        .WithDescription("Example test command.")
                        .WithExample(["yolo", "test"])
            );

        // Example: Set application name
        appServiceConfig.SetApplicationName("myapp");
    }
}

This example demonstrates:

  • Setting up configuration values in memory for development
  • Registering services with dependency injection
  • Creating commands at both root and nested levels
  • Adding command descriptions and usage examples

The resulting CLI will support commands like:

myapp test
myapp yolo test

MSBuild Properties

You can customize the build behavior using the following MSBuild properties:

  • UseDefaultProgram: Set to false to opt out of the default Program.cs file generation. This allows you to provide your own custom Program implementation.
    <PropertyGroup>
      <UseDefaultProgram>false</UseDefaultProgram>
    </PropertyGroup>
    

Example Projects

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2025.11.25.507 2,729 11/25/2025
2025.11.23.501 880 11/23/2025
2025.11.23.493 368 11/23/2025
2025.11.4.431 6,111 11/4/2025
2025.10.15.396 7,331 10/15/2025
2025.10.12.373 1,234 10/12/2025
2025.9.11.330 9,916 9/11/2025
2025.9.10.320 911 9/10/2025
2025.9.7.308 1,265 9/7/2025
2025.9.7.305 371 9/7/2025
2025.8.6.269 3,978 8/6/2025
2025.7.9.244 712 7/9/2025
2025.6.11.218 858 6/11/2025
2025.6.11.215 586 6/11/2025
2025.5.28.191 698 5/28/2025
2025.5.14.181 804 5/14/2025
2025.5.12.165 621 5/12/2025
2025.4.11.154 742 4/11/2025
2025.4.10.149 451 4/10/2025
2025.4.8.142 543 4/8/2025
2025.3.13.105 1,322 3/13/2025
2025.2.25.86 802 2/25/2025
2025.2.19.80 495 2/19/2025
2025.2.19.78 292 2/19/2025
2025.2.18.76 232 2/18/2025
2025.2.18.72 242 2/18/2025
2025.2.18.70 230 2/18/2025
2025.2.12.66 569 2/12/2025
2025.1.20.36 1,075 1/20/2025
2025.1.20.34 230 1/20/2025
2025.1.20.32 221 1/20/2025
2025.1.20.30 264 1/20/2025
2025.1.20.26 229 1/20/2025
2025.1.20.24 230 1/20/2025
2025.1.17.22 243 1/17/2025
2025.1.2.20 311 1/2/2025
2024.12.30.15 233 12/30/2024
2024.12.20.13 228 12/20/2024
2024.12.20.11 227 12/20/2024
2024.12.20.9 233 12/20/2024
2024.12.19.5 230 12/19/2024
2024.12.19.2 229 12/19/2024