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.
| Option | Default | What it does |
|---|---|---|
--include-ui | on | Include the Blazor web UI (UI.Common + UI.Web) and wire it into the Aspire AppHost. |
--use-redis | off | Add a Redis-protocol distributed cache (HybridCache L2), Valkey by default, and wire it into the Aspire AppHost. |
--use-serilog | off | Use Serilog for structured logging (console sink) in the API and web hosts, alongside OpenTelemetry. |
--use-multitenancy | off | 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. |
--include-ui-tests | off | Include a browser-driven UI test project (Playwright). Tests are opt-in at run time via RUN_UI_TESTS=1. |
--skip-restore | off | Skip 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.
--include-ui
Section titled “--include-ui”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.mdand.claude/agents/ui-reviewer.md. - Files it adds, only with
--include-ui-testsand--include-ui(on by default):tests/Trellis.UiTests/. - After creating: Nothing: the AppHost starts the
webresource beside theapi. With--include-ui falsethe 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
--use-redis
Section titled “--use-redis”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 thecacheresource, with a RedisInsight tile, and the API reads its connection string. In the dev-container flow,docker compose --profile redis up -dstarts Redis. - Read more: ADR-0026: Read caching with HybridCache, keys from one service · Deploy to one host
--use-serilog
Section titled “--use-serilog”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
Serilogsection, which mirrorsLogging:LogLevelbut is not read from it. - Read more: Observability
--use-multitenancy
Section titled “--use-multitenancy”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.csandtests/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
--include-ui-tests
Section titled “--include-ui-tests”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-testsand--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
--skip-restore
Section titled “--skip-restore”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 restoreyourself before the first build.
The documentation of Trellis.Templates 0.2.0 · release notes