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
<PackageReference Include="devdeer.Libraries.Consoles" Version="0.2.0" />
<PackageVersion Include="devdeer.Libraries.Consoles" Version="0.2.0" />
<PackageReference Include="devdeer.Libraries.Consoles" />
paket add devdeer.Libraries.Consoles --version 0.2.0
#r "nuget: devdeer.Libraries.Consoles, 0.2.0"
#:package devdeer.Libraries.Consoles@0.2.0
#addin nuget:?package=devdeer.Libraries.Consoles&version=0.2.0
#tool nuget:?package=devdeer.Libraries.Consoles&version=0.2.0
devdeer.Libraries.Consoles
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:
| Product | Versions 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. |
-
net10.0
- devdeer.Libraries.Hosting (>= 0.0.7)
- Microsoft.Extensions.Configuration.AzureAppConfiguration (>= 8.5.0)
- Microsoft.Extensions.Hosting (>= 10.0.10)
-
net8.0
- devdeer.Libraries.Hosting (>= 0.0.7)
- Microsoft.Extensions.Configuration.AzureAppConfiguration (>= 8.5.0)
- Microsoft.Extensions.Hosting (>= 10.0.10)
-
net9.0
- devdeer.Libraries.Hosting (>= 0.0.7)
- Microsoft.Extensions.Configuration.AzureAppConfiguration (>= 8.5.0)
- Microsoft.Extensions.Hosting (>= 10.0.10)
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.