JandaBox Console App - Jandini/JandaBox GitHub Wiki
ConsoleBox .NET template provides solution for console application with dependency injection, logging, and configuration. Default logger is Serilog. Use --serilog false parameter to switch to Microsoft console logger.
Template Options
-
--basicCreate basic console application with minimal amount startup code. Default value isfalse. -
--serilogUse Serilog. Default value istrue. -
--asyncCreate asynchronous code. Default value isfalse. -
--singlePublish as single file, self contained, win-x64 console application. -
--gitVersionAdd semantic versioning with GitVersion. The code created with this parameter can be only build from initialized git repository.dotnet new consolebox -n MyApp --git cd MyApp git init -b main git add . git commit -m "First commit" dotnet build src
Template features
- Repository Layout
- The
srcandbinfolders - Default
README.mdfile - Default
.gitignorefile - Default
launchSettings.jsonfile
- The
- Dependency Injection
- Main service with logging
- Dispose service provider
- Logging
SerilogorMicrosoftlog providers- Serilog environment enrichers
- Unhandled exceptions logging
- Configuration
- Embedded
appsettings.jsonfile - Override embedded
appsettings.jsonwith a file - Configuration binding
- Embedded
- Semantic Versioning
GitVersion.MsBuildpackage- Configuration
GitVersion.ymlfile
- Command Line Parser
- Verbs and options parser
- Asynchronous code
- Run Main with
asyncandawait
- Run Main with
- Release build without debug symbols
- Conditional project parameters for
Releaseconfiguration to suppress debug symbols
- Conditional project parameters for
Basic console application
Create basic console application with Microsoft console logger
dotnet new consolebox -n Basic --basic --serilog false
or console application with Serilog.
dotnet new consolebox -n Basic --simple
Default console application
Create console application with Serilog to console and file.
dotnet new consolebox -n MyApp
You can create console application with Microsoft console logger only.
dotnet new consolebox -n MyApp --serilog false