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
                    
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="tab3r.netcore.banner" Version="0.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="tab3r.netcore.banner" Version="0.0.1" />
                    
Directory.Packages.props
<PackageReference Include="tab3r.netcore.banner" />
                    
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 tab3r.netcore.banner --version 0.0.1
                    
#r "nuget: tab3r.netcore.banner, 0.0.1"
                    
#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 tab3r.netcore.banner@0.0.1
                    
#: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=tab3r.netcore.banner&version=0.0.1
                    
Install as a Cake Addin
#tool nuget:?package=tab3r.netcore.banner&version=0.0.1
                    
Install as a Cake Tool

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
  • Console — rendered and written to Console.Out immediately, before the host finishes building (matches Spring Boot's early CONSOLE mode).
  • Log — rendered once and emitted through ILogger<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 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. 
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.0.1 90 9/16/2026