Skip to content

Options

Options are flags of dotnet new and checkboxes in Visual Studio and Rider. A flag takes true or false, and a bare flag means true: dotnet new trellis -n Acme.Shop --use-multitenancy. The choices are recorded in the generated .trellis-template.json, which Upgrading regenerates from.

OptionDefaultWhat it does
--include-uionInclude the Blazor web UI (UI.Common + UI.Web) and wire it into the Aspire AppHost.
--use-redisoffAdd a Redis-protocol distributed cache (HybridCache L2), Valkey by default, and wire it into the Aspire AppHost.
--use-serilogoffUse Serilog for structured logging (console sink) in the API and web hosts, alongside OpenTelemetry.
--use-multitenancyoffAdd a tenant seam: a tenant claim on the principal (ITenantContext), a TenantId shadow column and a "Tenant" EF query filter on every aggregate root. Regenerate the initial migration after enabling.
--include-ui-testsoffInclude a browser-driven UI test project (Playwright). Tests are opt-in at run time via RUN_UI_TESTS=1.
--skip-restoreoffSkip the automatic 'dotnet restore' after the project is created. A command-line convenience: it changes nothing in the solution.

The sections below are generated from the template's own configuration when the site is built, so they say what dotnet new trellis --help and the generated solution say. On the other pages of this site, a passage that only some solutions have is marked with the option that keeps it.

On by default. In Visual Studio and Rider: “Include Blazor UI”.

Include the Blazor web UI (UI.Common + UI.Web) and wire it into the Aspire AppHost.

  • Files it adds: src/Presentation/UI/, tests/Trellis.ApiTests/Ui/, tests/Trellis.ArchitectureTests/DesignSystemTests.cs, tests/Trellis.ArchitectureTests/UiConventionTests.cs, .claude/rules/ui.md, docs/design-system.md, docs/adr/0032-ui-design-system.md and .claude/agents/ui-reviewer.md.
  • Files it adds, only with --include-ui-tests and --include-ui (on by default): tests/Trellis.UiTests/.
  • After creating: Nothing: the AppHost starts the web resource beside the api. With --include-ui false the solution is API-only.
  • Read more: ADR-0015: Shared render-mode-agnostic UI component library · ADR-0012: Presentation split into Api and UI, each with a Common library

Off by default. In Visual Studio and Rider: “Use a Redis-protocol cache (Valkey)”.

Add a Redis-protocol distributed cache (HybridCache L2), Valkey by default, and wire it into the Aspire AppHost.

  • Files it adds: none of its own. Its code sits in conditional blocks of files every solution has.
  • After creating: Nothing for aspire run: the AppHost starts the cache resource, with a RedisInsight tile, and the API reads its connection string. In the dev-container flow, docker compose --profile redis up -d starts Redis.
  • Read more: ADR-0026: Read caching with HybridCache, keys from one service · Deploy to one host

Off by default. In Visual Studio and Rider: “Use Serilog”.

Use Serilog for structured logging (console sink) in the API and web hosts, alongside OpenTelemetry.

  • Files it adds: tests/Trellis.ApiTests/InProcess/SerilogExportTests.cs.
  • After creating: Nothing. Serilog writes the console and hands every event on to OpenTelemetry; its levels come from the Serilog section, which mirrors Logging:LogLevel but is not read from it.
  • Read more: Observability

Off by default. In Visual Studio and Rider: “Use multi-tenancy”.

Add a tenant seam: a tenant claim on the principal (ITenantContext), a TenantId shadow column and a "Tenant" EF query filter on every aggregate root. Regenerate the initial migration after enabling.

  • Files it adds: src/Core/Trellis.Application/Abstractions/ITenantContext.cs, src/Core/Trellis.Application/Abstractions/AmbientTenant.cs, src/Presentation/Api/Trellis.Api.Common/Http/TenantContext.cs, src/Infrastructure/Trellis.Persistence/Interceptors/TenantInterceptor.cs, src/Infrastructure/Trellis.Persistence/SystemTenantContext.cs, tests/Trellis.IntegrationTests/TenancyTests.cs and tests/Trellis.ApiTests/InProcess/TenantIsolationTests.cs.
  • dotnet new reminds you: “Multi-tenancy is on: regenerate the initial migration before the first run (docs/development.md, 'Multi-tenancy').”
  • After creating: Regenerate the shipped initial migration once, before the first run: it has no tenant columns. The two commands are in Multi-tenancy.
  • Read more: Multi-tenancy (optional) · ADR-0019: Multi-tenancy as an opt-in template toggle · ADR-0022: Tenant on the principal

Off by default. In Visual Studio and Rider: “Include Playwright UI tests”.

Include a browser-driven UI test project (Playwright). Tests are opt-in at run time via RUN_UI_TESTS=1.

  • Files it adds, only with --include-ui-tests and --include-ui (on by default): tests/Trellis.UiTests/.
  • After creating: Build the project once and install a browser before the first browser run; the tests skip unless RUN_UI_TESTS=1. See UI tests.
  • Read more: UI tests (optional) · Testing

Off by default. Command line only.

Skip the automatic 'dotnet restore' after the project is created.

  • A command-line convenience: it changes nothing in the solution.
  • After creating: Run dotnet restore yourself before the first build.

The documentation of Trellis.Templates 0.2.0 · release notes