Templates for common files/configs in .NET projects. The continuous integration is disabled in this template repository since there is no solution, thus avoiding unnecessary runs.
- Create a new repository based on this repository:
-
Go to this repository's page, click on the
Use this template
button and follow instructions.OR
-
With GitHub's CLI, run:
gh repo create NEW_REPOSITORY_NAME --template=dmarcoux/dotnet_templates --clone --private/--public
-
Search for
CHANGEME
in the newly created repository to adapt it to the project's needs. -
Start the development environment to run the commands from the next steps:
nix develop
-
Generate
.gitignore
fromdotnet new
and append the content of .gitignore:dotnet new gitignore && cat .gitignore.template >> .gitignore && rm .gitignore.template
Note: By generating
.gitignore
, we don't have to keep track of the changes in thedotnew new gitignore
template. -
Generate
.editorconfig
to follow the default .NET code style:dotnet new editorconfig
Note: By generating
.editorconfig
, we don't have to keep track of the changes in thedotnew new editorconfig
template. -
Generate
global.json
to enforce a specific .NET SDK version with .NET CLI commands and continuous integration.just generateGlobalJson
Note: By generating
global.json
, we don't have to manually enter the version number of the .NET SDK installed in the development environment. -
Adapt this README to the project. This complete section can be deleted...
Reproducible development environment for .NET projects which relies on Nix Flakes, a purely functional and cross-platform package manager.
Start development environment:
nix develop
Once inside the development environment...
...launch JetBrains Rider or another IDE:
# Launch JetBrains Rider
just code
# Launch Visual Studio Code
just code code
...or perhaps execute any of the other just recipes/commands included in the justfile:
# List all available just recipes
just
The continuous integration builds the solution with code analyzers (set in Directory.Build.props), verifies that all code is correctly formatted and runs tests to ensure the codebase stays in a workable state while upholding code quality standards.