A curated set of .NET templates for bootstrapping projects and configs. Built around my workflow, but easy to fork or adapt.
-
Clone the repo:
git clone https://github.com/disgone/bitcrafter-templates.git
-
Go to the repo directory:
cd bitcrafter-templates -
Install the templates:
dotnet new install .
Once installed, use the templates with dotnet new.
dotnet new listdotnet new bitcrafter-buildpropsWith optional metadata:
dotnet new bitcrafter-buildprops -au "Janet Doe" -c "Some Company, LLC"Adds a .editorconfig file to help keep code style consistent across your projects.
Creates a Directory.Build.props file with common project settings, designed to centralize build configurations:
- Assembly Metadata: Configures common assembly information like authors, company, and copyright.
- Code Analysis: Enables .NET analyzers and enforces code style in build. By default, build warnings are treated as errors.
- Deterministic Builds: Ensures reproducible builds by setting the
Deterministicproperty totrue. - Source Link: Conditionally enables Source Link properties for projects intended to be packed as NuGet packages, improving debugging experience.
- Central Package Management (CPM): Optionally enables CPM for the solution, promoting consistent package versioning.
Usage with optional parameters:
dotnet new bitcrafter-buildprops -au "Janet Doe" -c "Some Company, LLC" --twae false --cpm falseParameters:
-auor--authors: Sets the 'Authors' assembly metadata.-cor--company: Sets the 'Company' assembly metadata.--twaeor--treat-warnings-as-errors: Set totrue(default) to treat build warnings as errors, orfalseto allow warnings.--cpmor--enable-cpm: Set totrue(default) to enable Central Package Management, orfalseto disable.