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
-
--basic
Create basic console application with minimal amount startup code. Default value isfalse
. -
--serilog
Use Serilog. Default value istrue
. -
--async
Create asynchronous code. Default value isfalse
. -
--single
Publish as single file, self contained, win-x64 console application. -
--gitVersion
Add 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
src
andbin
folders - Default
README.md
file - Default
.gitignore
file - Default
launchSettings.json
file
- The
- Dependency Injection
- Main service with logging
- Dispose service provider
- Logging
Serilog
orMicrosoft
log providers- Serilog environment enrichers
- Unhandled exceptions logging
- Configuration
- Embedded
appsettings.json
file - Override embedded
appsettings.json
with a file - Configuration binding
- Embedded
- Semantic Versioning
GitVersion.MsBuild
package- Configuration
GitVersion.yml
file
- Command Line Parser
- Verbs and options parser
- Asynchronous code
- Run Main with
async
andawait
- Run Main with
- Release build without debug symbols
- Conditional project parameters for
Release
configuration 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