Skip to main content

.NET Process Boilerplate

Exploring standardized boilerplate for a variety of process types.

Here's a known list of process types:

  • Windows Form running as a short-lived client application
  • Long-running Windows Service.
  • Long-running Task Tray app.
  • Short-lived admin task.
  • Camunda worker service.

General Process Needs

  • Startup Debug Hooks
  • Configuration Service
  • Secrets Service
  • Logging Service
  • Telemetry Service
  • Status Publishing Service 

Startup Debug Hooks

Top of Program:main, we include an optional debug spin-wait.

This is triggered by a command-line argument to debug the process.

If activated, the process will wait for a debugger to connect, so early startup activities can be diagnosed.

See this page for implementation details: DotNet Startup Remote Debugging Hook

Secrets Service

  • Initial Process Secret - SPIRE-given secret, used to retrieve client token for secrets access.
  • Secrets - pulled from central secrets store

Configuration Service

 

Logging Service

  • Logging Service- config defining where to store or ship logs.
  • Folder Locations - for log files and local configuration

Telemetry Service

publishes action spans and metrics.

Status Publishing Service

For publishing when a process starts, ends, errors, and periodically while running.