Application templates for .Net Core 2.2 and .Net Standard 2.0 that make use of dependency injection, logging, metrics, and configuration using the option pattern.
I wanted to make use of the sweet GenericHost goodness in .NET Core, as well as having logging and dependency injection in quick test projects, but I always end up forgetting stuff up... enter templates!
A console application that can be run as a Windows service, functions as a .NET Generic Host to run background services. Exposes Prometheus metrics from all loaded components.
A project for creating a generic background service library that targets .NET Standard or .NET Core and can run via console or ASP Core 2.2 application. Includes dependency injection, logging, metrics, and configuration using the option pattern.
A project for creating a dependency injected class library that targets .NET Standard or .NET Core. Includes dependency injection, logging, metrics, and configuration using the option pattern.
You can use the templates in three ways:
- Grab the nuget package
dotnet new -i RandomChance.Common.Templates
or if it's localdotnet new -i <PATH_TO_NUPKG_FILE>
- Clone this repo then then add the projects directly
dotnet new -i <templates/BackgroundService>
- Package it yourself... because you can..? run
dotnet pack
in the root of this repo, then add thedotnet new -i bin\Debug\RandomChance.Common.Templates.0.1.0.nupkg
Note that to uninstall a template you added from the filesystem you have to specify the Absolute Path
dotnet new -u <ABSOLUTE_PATH_TO_TEMPLATE>
- Service Host should handle command line args better (at all)
InjectedLibrary
is a kinda silly sounding, I should name it better- Examples and description in each template.