tab3r.netcore.banner
0.0.1
dotnet add package tab3r.netcore.banner --version 0.0.1
NuGet\Install-Package tab3r.netcore.banner -Version 0.0.1
<PackageReference Include="tab3r.netcore.banner" Version="0.0.1" />
<PackageVersion Include="tab3r.netcore.banner" Version="0.0.1" />
<PackageReference Include="tab3r.netcore.banner" />
paket add tab3r.netcore.banner --version 0.0.1
#r "nuget: tab3r.netcore.banner, 0.0.1"
#:package tab3r.netcore.banner@0.0.1
#addin nuget:?package=tab3r.netcore.banner&version=0.0.1
#tool nuget:?package=tab3r.netcore.banner&version=0.0.1
netcore.banner
A Spring Boot–style startup banner for ASP.NET Core (Generic Host applications), built for .NET 8+ with zero third-party dependencies.
Easy to setup: Add one line to Program.cs and get a customizable, placeholder-aware, ANSI-colored banner printed automatically when your service starts, just like Spring Boot does out of the box.
Install
dotnet add package tab3r.netcore.banner
Quick start
using NetCore.Banner;
var builder = WebApplication.CreateBuilder(args);
// Do your MAGIC!!!!
builder.Host.UseBanner();
var app = builder.Build();
app.Run();
That's it. On startup you'll see either your own banner.txt (if present at the content root) or the built-in default banner.
Custom banner.txt
Drop a banner.txt file at your project's content root (copy it to the output directory) and use placeholders.
For example, this is the default banner.txt built-in:
_ _ _ ____
| \ | | ___| |_ / ___|___ _ __ ___
| \| |/ _ \ __| | / _ \| '__/ _ \
| |\ | __/ |_| |__| (_) | | | __/
|_| \_|\___|\__|\____\___/|_| \___|
${AnsiColor.GREEN} :: ${application.name:-Application} ::${Ansi.NORMAL} ${application.formatted-version:-}
:: powered by ${dotnet.version} :: ${environment.name:-Production}
Make sure the file is copied on build:
<ItemGroup>
<None Update="banner.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
Placeholders
The library allow use placeholders for useful information in the app startup.
| Placeholder | Resolves to |
|---|---|
${application.name} |
IHostEnvironment.ApplicationName |
${application.version} |
Entry assembly informational/file version |
${application.formatted-version} |
(v{version}), or empty if unavailable |
${dotnet.version} |
RuntimeInformation.FrameworkDescription |
${os.name} |
RuntimeInformation.OSDescription |
${environment.name} |
IHostEnvironment.EnvironmentName |
${ENV:VAR_NAME} |
Environment variable VAR_NAME |
${Any:ConfigKey} |
Falls back to IConfiguration[key] |
Default values: use ${key:-fallback} (note the :- separator, not a plain :) so it never collides with IConfiguration's own : hierarchy separator, e.g. ${Custom:Section:Key} still resolves as a single configuration key.
Colors: ${AnsiColor.RED}, ${AnsiBackground.GREEN}, ${AnsiStyle.BOLD}, and ${Ansi.NORMAL} (reset) emit ANSI escape codes. They are automatically disabled when the output is redirected, when NO_COLOR is set, or when TERM=dumb.
Configuration
Bind via the Banner section in appsettings.json:
{
"Banner": {
"Mode": "Console",
"Location": "banner.txt",
"Charset": "UTF-8",
"AnsiMode": "Detect"
}
}
or override programmatically:
builder.Host.UseBanner(options =>
{
options.Mode = BannerMode.Log;
options.Location = "custom-banner.txt";
});
Configuration options
| Option | Values | Default | Description |
|---|---|---|---|
Mode |
Console | Log | Off |
Console |
Where the banner is printed (equivalent to Spring's spring.main.banner-mode) |
Location |
file path | banner.txt |
Banner file, resolved against IHostEnvironment.ContentRootFileProvider |
Charset |
encoding name | UTF-8 |
Encoding used to read the banner file |
AnsiMode |
Detect | Always | Never |
Detect |
Whether ANSI color placeholders are rendered |
Banner modes
Console— rendered and written toConsole.Outimmediately, before the host finishes building (matches Spring Boot's earlyCONSOLEmode).Log— rendered once and emitted throughILogger<BannerHostedService>as soon as logging is available.Off— no banner is printed.
Sample
See samples/SampleWebApi for a runnable ASP.NET Core Web API demonstrating a custom banner.txt, appsettings.json configuration, and all three banner modes.
| 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 was computed. 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 was computed. 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. |
-
net8.0
- Microsoft.Extensions.Configuration.Binder (>= 8.0.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
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.0.1 | 90 | 9/16/2026 |