devdeer.Libraries.Consoles 0.2.0

dotnet add package devdeer.Libraries.Consoles --version 0.2.0
                    
NuGet\Install-Package devdeer.Libraries.Consoles -Version 0.2.0
                    
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="devdeer.Libraries.Consoles" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="devdeer.Libraries.Consoles" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="devdeer.Libraries.Consoles" />
                    
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 devdeer.Libraries.Consoles --version 0.2.0
                    
#r "nuget: devdeer.Libraries.Consoles, 0.2.0"
                    
#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 devdeer.Libraries.Consoles@0.2.0
                    
#: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=devdeer.Libraries.Consoles&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=devdeer.Libraries.Consoles&version=0.2.0
                    
Install as a Cake Tool

devdeer.Libraries.Consoles

NuGet Downloads

Disclaimer

If you want to use this package you should be aware of some principles and practices we at DEVDEER use. So be aware that this is not backed by a public repository. The purpose here is to give out customers easy access to our logic. Nevertheless you are welcome to use this lib if it provides any advantages.

Summary

TODO

Quickstart

Create a new console project and install the Nuget package:

dotnet new console -n Sample
cd Sample
dotnet add package devdeer.Libraries.Consoles --prerelease

Open the project in your favorite editor and replace the code of Program.cs with:

using devdeer.KhanSample.Ui.SampleConsoleApp;
using devdeer.Libraries.Consoles;
using devdeer.Libraries.Hosting.Extensions;

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

return await ConsoleHelper.RunHostedAsync<MyApp>(
    args,
    opt =>
    {
        opt.OnBuilderCreated = builder =>
        {
            // YOU SHOULD ALWAYS CALL THIS METHOD!
            builder.ConfigureDefaults(false, "Console");
        };
        opt.BeforeDefaultServicesConfigured = (_, services) =>
        {
        };
        opt.OnHostSuccess = (ctx, res) =>
        {
            var logger = ctx.Services.GetRequiredService<ILogger<Program>>();
            logger.LogInformation("App succeeded");
            Console.WriteLine("✔️ App succeeded");
            return res;
        };
        opt.OnHostFaulted = (ctx, ex, r) =>
        {
            var logger = ctx.Services.GetRequiredService<ILogger<Program>>();
            logger.LogError($"App failed: {ex.Message}");
            Console.WriteLine($"😒 App failed: {ex?.Message ?? "Unkown"}");
            return r;
        };
    });

class MyApp : IConsoleApp
{
    public MyApp(ILogger<MyApp> logger, IConfiguration configuration)
    {
        Logger = logger;
        Configuration = configuration;
    }

    /// <inheritdoc />
    public Task<int> RunAsync(string[] args)
    {
        Logger.LogInformation("App is started.");
        // Only works if you have a value "A" in the config
        Console.WriteLine($"A is {Configuration["A"]}");
        Console.Write("Enter a number: ");
        var input = Console.ReadLine();
        if (!int.TryParse(input, out var number))
        {
            throw new InvalidOperationException("You did non enter a number.");
        }
        var result = 100 / number;
        Console.WriteLine($"The calculation resulted in {result}.");
        return Task.FromResult(0);
    }

    private ILogger<MyApp> Logger { get; }

    private IConfiguration Configuration { get; }

}

About DEVDEER

DEVDEER is a company from Magdeburg, Germany which is specialized in consulting, project management and development. We are very focussed on Microsoft Azure as a platform to run our products and solutions in the cloud. So all of our backend components usually runs in this environment and is developed using .NET. In the frontend area we are using react and a huge bunch of packages to build our UIs.

You can find us online:

Website

GitHub GitHub Org's stars

YouTube YouTube Channel Subscribers YouTube Channel Views

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
0.2.0 0 7/16/2026
0.1.0 0 7/16/2026
0.0.2-alpha 36 7/15/2026
0.0.1-alpha 35 7/14/2026

- BREAKING: Some options where removed, inheritance to hosting package and more stuff like this 😂.
- Using Hosting package as base now.
- Using new dependency chain which internally uses new namespaces.