BenjaminMichaelis.Dotnet.Templates 2.0.1-beta.564

This is a prerelease version of BenjaminMichaelis.Dotnet.Templates.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet new install BenjaminMichaelis.Dotnet.Templates::2.0.1-beta.564
                    
This package contains a .NET Template Package you can call from the shell/command line.

Dotnet Templates

The repository contains a set of opinionated dotnet new templates. I am happy to receive critique/feedback on the existing templates, so feel free to open issues.

Requirements

These templates require .NET 9.0 SDK or later.

Installing

Use dotnet new install to install the templates.

> dotnet new install BenjaminMichaelis.Dotnet.Templates

To then use a template, navigate to a directory where you want to use the template and use the command

> dotnet new bmichaelis.{templatename}

with templatename being a name of one of the included templates listed below. Ex: dotnet new bmichaelis.nuget

Included Templates (by template name, prepending bmichaelis. before the name as shown above)

Updating

If you have previously installed the templates and want to install the latest version, you can use dotnet new update to update your installed templates.

> dotnet new update

Uninstalling

> dotnet new uninstall BenjaminMichaelis.Dotnet.Templates

Local testing

Build the template package:

> dotnet pack --configuration Release -o .

Install the locally built template package

> dotnet new install . --force

You can now test the template by running:

> dotnet new bmichaelis.{templatename}
> dotnet build
> dotent test --no-build
> dotnet publish --no-build

When done, you can remove the local install of the template package by running:

> dotnet new uninstall .

Adding a new template

  • Add project under the template directory
  • Update .template.config in directory
  • Copy root .editorconfig to template directory (or run ./CopyEditorConfigToTemplates.ps1)
  • Update dependabot.yml
  • Update build.yml workflow
  • Add to README

EditorConfig Management

Each template includes an .editorconfig file that is based on the root repository's .editorconfig. This ensures consistent coding standards across all generated projects.

For new templates:

  • Copy the root .editorconfig to your template directory
  • Or run ./CopyEditorConfigToTemplates.ps1 to copy to all templates

For template-specific customizations:

  • Templates can have their own .editorconfig customizations (e.g., the NuGet template has more relaxed var usage rules)
  • When updating the root .editorconfig, use the CopyEditorConfigToTemplates.ps1 script which will detect and preserve existing customizations

When updating root .editorconfig:

Automated Process (Recommended):

  • Simply update the root .editorconfig file and push to main
  • The update-template-editorconfig GitHub Actions workflow will automatically:
    • Detect the changes and run the copy script
    • Create or update a PR with the template updates
    • Preserve existing customizations and create backups for manual review
    • Provide clear documentation of what was changed

Manual Process:

  1. Update the root .editorconfig file
  2. Run ./CopyEditorConfigToTemplates.ps1
  3. Review any templates with customizations and manually merge changes if needed
  4. Test all templates to ensure they work correctly
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.1-beta.565 31 9/27/2025
2.0.1-beta.564 75 9/26/2025
2.0.1-beta.562 108 9/24/2025
2.0.1-beta.561 113 9/23/2025
2.0.1-beta.554 253 9/16/2025
2.0.1-beta.552 103 9/14/2025
2.0.1-beta.548 124 9/10/2025
2.0.1-beta.547 125 9/9/2025
2.0.1-beta.537 184 8/30/2025
2.0.1-beta.526 141 8/19/2025
2.0.1-beta.519 149 8/12/2025
2.0.1-beta.498 548 7/22/2025
2.0.1-beta.491 154 7/15/2025
2.0.1-beta.470 164 6/24/2025
2.0.0 447 3/30/2024
2.0.0-beta.464 158 6/18/2025
1.1.2 2,002 1/11/2024
1.1.1 1,425 11/28/2023
1.0.1 701 4/3/2023
1.0.0 287 4/3/2023