Csharp.DotStyle.Templates 1.0.0

dotnet new install Csharp.DotStyle.Templates@1.0.0
                    
This package contains a .NET Template Package you can call from the shell/command line.

DotStyle Templates — Template Pack Source

NuGet

This repo produces an installable dotnet new template that drops the DotStyle .NET code governance baseline into an existing repo with one command.

What this template installs

The template creates the standard DotStyle baseline files:

  • AGENTS.md
  • .editorconfig
  • Directory.Build.props
  • global.json
  • .vscode/settings.json
  • .gitignore
  • .github/workflows/code-style.yml
  • .github/instructions/csharp.instructions.md

Branding and package identity

  • Package ID: Csharp.DotStyle.Templates
  • Template short name: dotnet-governance
  • Template identity: Csharp.DotStyle.Templates.DotStyleBaseline
  • Author / company: Majdi ZLITNI
  • License: MIT

Local test workflow

Install from the source folder first:

dotnet new install ./content/dotnet-governance

Then run a throwaway dry run in a scratch folder:

dotnet new dotnet-governance --dry-run \
  --project-name DotStyle.Sample \
  --target-framework net10.0 \
  --solution-layout "src/, tests/" \
  --sdk-version 10.0.100 \
  --dotnet-sdk-channel 10.0.x

If the output looks right, generate it for real in a temporary repo and verify that the tokens in AGENTS.md and global.json are replaced correctly.

Uninstall the folder-based install when you are done:

dotnet new uninstall ./content/dotnet-governance

Package and publish

Pack the template:

dotnet pack -c Release

Install the built package locally and re-test:

dotnet new install ./bin/Release/Csharp.DotStyle.Templates.1.0.0.nupkg
dotnet new list dotnet-governance

Publish to NuGet when ready:

dotnet nuget push bin/Release/*.nupkg \
  --source https://api.nuget.org/v3/index.json \
  --api-key <your-api-key>

Release checklist

Use this checklist before every release:

  1. Bump PackageVersion in DotnetGovernanceTemplates.csproj.
  2. Keep identity in content/dotnet-governance/.template.config/template.json unchanged unless you are intentionally creating a new template.
  3. Re-run dotnet pack -c Release.
  4. Reinstall the .nupkg locally with dotnet new install ./bin/Release/Csharp.DotStyle.Templates.<version>.nupkg.
  5. Re-run the --dry-run generation test.
  6. Confirm the package metadata and README still render correctly on NuGet.
  7. Push the new package to your feed.

Versioning guidance

  • Use semantic versioning for PackageVersion.
  • Increase patch versions for doc, metadata, or non-breaking template updates.
  • Increase minor versions for new template features or additional generated files.
  • Increase major versions when you make breaking changes to the generated output or install flow.
  • Keep the template identity stable so upgrades remain predictable.

Notes on conflicts

If an existing repository already contains files like .editorconfig or .github/workflows/code-style.yml, dotnet new will report the conflicts. Review the diff first, then use --force only when you want the template to overwrite the existing files.

  • .NETStandard 2.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
1.0.0 183 7/18/2026