Centeva.Templates 5.1.1

Prefix Reserved
dotnet new install Centeva.Templates@5.1.1
                    
This package contains a .NET Template Package you can call from the shell/command line.

Centeva Project Templates

This is a set of templates for creating new .NET projects using Centeva architecture practices.

View the README from within each template's folder to get details.

Installation

dotnet new install Centeva.Templates

Updating

dotnet new update Centeva.Templates

Usage

To get a list of available templates, use the command below (this shows all the built-in templates as well):

dotnet new list

Templates may have parameters for customizing project creation. You can see any available options for a template with the following command, and then specify those options when you create a project with the template.

dotnet new centeva-webapi --help

centeva-webapi

Creates a new .NET Web API solution using Centeva architecture practices.

dotnet new centeva-webapi -n NewProject

Use the --UseAspire option to set the solution up with Aspire for running the application and its development services (SQL Server) locally, instead of a docker-compose.yml file:

dotnet new centeva-webapi -n NewProject --UseAspire true

centeva-classlib

Creates a new .NET class library solution with NuGet publishing workflows.

dotnet new centeva-classlib -n NewProject

You can then open the generated solution file. Projects, folders, and namespaces will already be named accordingly.

Contributing

See the documentation for creating .NET CLI templates to learn the basics.

To add a new template, create a new folder inside templates.

Testing changes

The best way to test a template is to generate a project from it, then build and run that project. Generating a project processes the template's conditional sections and parameters, so the output can differ from the files in this repository. In particular, template directives such as //#if (UseAspire) are comments, so in the repository all branches of a conditional are present as live code. Always check the generated output, and generate a project with each combination of parameters that you changed.

Use a custom hive to install the template from your working copy without affecting your normal dotnet new installation. These commands work in bash, PowerShell, and cmd. Run them from the root of this repository; the hive and the generated projects are created next to the repository folder, outside of it. (Paths are relative on purpose: ~ and environment variables are expanded differently by each shell, and dotnet does not expand ~ itself.)

# Install the template from your working copy (repeat after every change)
dotnet new install templates/webapi --debug:custom-hive ../template-hive

# Generate a project; the template's parameters are listed with --help
dotnet new centeva-webapi --help --debug:custom-hive ../template-hive
dotnet new centeva-webapi -n Acme.Api -o ../template-test/default --debug:custom-hive ../template-hive
dotnet new centeva-webapi -n Acme.Api -o ../template-test/aspire --UseAspire true --debug:custom-hive ../template-hive

# Build and test the generated projects.  Run the tests from inside each project's
# folder so that its global.json is used.
cd ../template-test/default
dotnet build
dotnet test
cd ../aspire
dotnet build
dotnet test

The webapi functional tests and the Aspire AppHost need Docker. Then run the generated project the way a developer would (for example aspire run for a project generated with --UseAspire true) to make sure it works.

When you are done, change back to the repository folder and remove the hive and the generated projects:

# bash
rm -rf ../template-hive ../template-test
# PowerShell
Remove-Item -Recurse -Force ../template-hive, ../template-test

Without a custom hive, use dotnet new install <path> and dotnet new uninstall <path> instead. If you have already installed the published Centeva.Templates package, uninstall it first or the template short names will conflict.

Deployment

This package is released by publishing a Release in GitHub. The CI/CD workflow will automatically build and publish the package.

  • Stable releases: Published to nuget.org using Trusted Publishing (OIDC) — no long-lived API key is stored in the repository. This requires a one-time setup on nuget.org (see below) and a NUGET_USER secret containing your nuget.org username.
  • Pre-releases: Published to GitHub Packages. No additional secrets are required — the workflow uses the built-in GITHUB_TOKEN.

To publish a release, create a new Release in GitHub with a SemVer tag (e.g. 1.2.3 or 1.2.3-alpha.1) and click Publish release. Check the "Set as a pre-release" checkbox to publish to GitHub Packages instead of nuget.org.

One-time Trusted Publishing setup on nuget.org
  1. Sign in to nuget.org and go to your username → Trusted Publishing.
  2. Add a new trusted publishing policy with:
    • Repository Owner: your GitHub org/user (e.g. Centeva)
    • Repository: the repository name (e.g. Centeva.Templates)
    • Workflow File: release.yml
  3. Add a NUGET_USER secret to the GitHub repository (Settings → Secrets and variables → Actions) containing your nuget.org username (profile name, not email address).
  • .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
5.1.1 53 11/17/2026
5.1.0 159 10/6/2026
5.0.3 213 9/2/2026
5.0.2 210 9/2/2026
5.0.1 367 5/29/2026
5.0.0 342 5/21/2026
4.0.0 3,726 12/6/2023
3.0.0 778 12/6/2023
2.0.0 798 12/6/2023