Skip to content

Latest commit

 

History

History
961 lines (725 loc) · 56.1 KB

README.md

File metadata and controls

961 lines (725 loc) · 56.1 KB

CoreEx.Template

Provides the dotnet new template pack for CoreEx solutions and standalone integrations -- ten composable templates, one dotnet new install.

Overview

CoreEx.Template is a PackageType=Template NuGet package that installs ten dotnet new templates as a single unit. They cover independent repository/test scaffolding, design-time CodeGen, AI assets, full shared-domain solutions, deployable hosts, an optional domain layer and Aspire orchestration.

Short name Template Emits
coreex-ai CoreEx AI assets .github/ instructions, prompts, skills, and agents + .claude/ commands — run at repo root; supports --app-folder for monorepos
coreex CoreEx domain-based microservice application Solution scaffold: src/ libraries + tools/ projects + tests/ (Test.Common + Test.Unit)
coreex-domain CoreEx Domain layer src/[name].Domain/ DDD project — add-on, run after coreex when domain complexity warrants it
coreex-api CoreEx API host src/[name].Api/ host project + tests/[solution].Test.Api/ integration test project
coreex-relay CoreEx Outbox Relay host src/[name].Relay/ host project + tests/[solution].Test.Relay/ integration test project
coreex-subscribe CoreEx Subscriber host src/[name].Subscribe/ host project + tests/[solution].Test.Subscribe/ integration test project
coreex-aspire CoreEx Aspire AppHost aspire/[name].Aspire/ AppHost project orchestrating this solution's own hosts — add-on, run after the hosts it references already exist
coreex-functions CoreEx Azure Functions host src/[name]/ empty isolated-worker host + matching tests/[host-prefix].Test.Functions/ project; no sample triggers or test cases
coreex-solution CoreEx solution baseline .slnx, root build/package conventions, guidance and lightweight tests/[name].Test.Common/ by default; no business layers
coreex-codegen CoreEx code-generation console Independent tools/[name]/ console; full name ends .CodeGen, no database/ref-data prerequisite

Parameters are consistent across templates -- the same --data-provider, --messaging-provider, and feature flags appear in every template that needs them, ensuring the generated code is coherent regardless of which templates you use.

Installation

dotnet new install CoreEx.Template::<version>

Pin <version> to the project's referenced CoreEx NuGet version. For first-time adoption without a CoreEx reference, resolve the latest stable release explicitly and record that version.

To verify:

dotnet new list --tag CoreEx

To update after a new release:

dotnet new install CoreEx.Template::<new-version>

To uninstall:

dotnet new uninstall CoreEx.Template

AI-Guided Scaffolding

coreex-ai is the primary way to install CoreEx AI workflow assets into any repository. It outputs only .github/ and .claude/ artefacts and is intentionally decoupled from the implementation scaffolding:

  • .github/instructions/coreex.instructions.md -- CoreEx coding context (replaces copilot-instructions.md)
  • .github/instructions/*.instructions.md -- scoped coding conventions per layer/file type
  • .github/skills/ -- 24 CoreEx skills: bootstrap, scaffold, docs-sync, 17 per-capability (L1) skills, and four end-to-end (L2) workflows
  • .github/prompts/ -- 23 wrappers for bootstrap, scaffold, and all L1/L2 skills; docs-sync is invoked directly as a skill
  • .github/agents/coreex-expert.agent.md -- /coreex-expert: architecture guidance
  • .claude/commands/coreex-expert.md -- /coreex-expert for Claude Code
  • .claude/commands/ -- 25 commands: one per CoreEx skill plus expert guidance; /coreex-docs-sync refreshes the entire version-pinned bundle after a package version bump
  • .github/docs/coreex/ -- 12 architecture/setup docs, 21 package guides, File configuration references/schema, and manifest.txt recording the installed coreex-version

The generic acquire-codebase-knowledge and aspire skills are framework-repository-only and are not emitted by coreex-ai. See the full workflow inventory.

Recommended day-1 workflow:

# Step 1 (always from repo root): install AI workflow assets
dotnet new coreex-ai

# For monorepos where CoreEx lives under a subfolder:
dotnet new coreex-ai --app-folder backend

# Step 2 (from the solution directory): scaffold the implementation
dotnet new coreex -n Avanade.Erp.Sales --data-provider SqlServer ...

coreex and the host templates no longer emit any .github/ artefacts -- run coreex-ai separately to get AI context. The two are independent and can be combined in any order.

For a brand-new blank repository, run /coreex-bootstrap after dotnet new coreex-ai. The skill generates root guidance files (README.md, AGENTS.md, CLAUDE.md) and immediately chains to /coreex-scaffold for solution shaping.

Typical greenfield flow:

# Step 1: install AI workflow assets (includes /coreex-bootstrap skill)
dotnet new coreex-ai

# Step 2: generate root guidance files and begin solution interview
# (run in Copilot Chat or Claude Code)
/coreex-bootstrap

Then answer the /coreex-scaffold questions. Full shared domains use coreex and selected addons. Standalone Functions normally uses coreex-solution for root conventions/Test.Common, then coreex-functions --shared-core false with the actual common reference. CodeGen is an optional independent addon. /coreex-functions adds actual capabilities and tests.


Naming Convention

The templates use dot-delimited names that encode the solution hierarchy. Understanding this is essential -- the name you supply drives all file names, namespace declarations, project cross-references, and configuration values automatically.

Recommended format: [Company].[Product].[Domain]

Segment Example Role
Company Avanade Organisation
Product Erp Product or system
Domain Sales The bounded context being scaffolded

For the solution template (coreex) the name is the three-part solution root, e.g. Avanade.Erp.Sales. For each host template (coreex-api, coreex-relay, coreex-subscribe) the name appends the host suffix, e.g. Avanade.Erp.Sales.Api.

Derived values (example: Avanade.Erp.Sales.Api)

Derived symbol Value Used for
domain-name Sales Class names, namespaces, DB identifiers (mixed case)
domain-name-lower sales Service Bus topic/subscription names, Postgres database name
solution-name Avanade.Erp.Sales Cross-project references in host .csproj files
solution-parent-name Avanade.Erp CoreEx:Host:SolutionName in appsettings.json

Template 1 -- coreex-ai (AI workflow assets)

Installs CoreEx AI workflow assets into any repository. Always run from the repo root — this is where .github/ must land for GitHub Copilot to read it.

This template emits nothing but .github/ and .claude/ artefacts: no AGENTS.md, no README.md, no implementation scaffolding. It is safe to run against an existing repository. Root guidance files for a brand-new, empty repository are generated by the /coreex-bootstrap skill instead (shipped as part of this template's .github/skills/ output) -- see the recommended day-1 workflow above.

Parameters

Parameter Type Default Description
--app-folder string (empty) The subfolder where the CoreEx application lives, relative to the repo root (for monorepos, e.g. backend or services/api). Leave blank for single-repo projects.

Outputs

.github/
  instructions/
    coreex.instructions.md         # CoreEx coding context (applyTo: "**" or "<app-folder>/**")
    coreex-api-controllers.instructions.md
    coreex-application-services.instructions.md
    coreex-aspire.instructions.md
    coreex-contracts.instructions.md
    coreex-conventions.instructions.md
    coreex-domain.instructions.md
    coreex-event-subscribers.instructions.md
    coreex-functions.instructions.md
    coreex-files.instructions.md
    coreex-host-setup.instructions.md
    coreex-repositories.instructions.md
    coreex-tests.instructions.md
    coreex-tooling.instructions.md
    coreex-validators.instructions.md
  prompts/
    coreex-*.prompt.md             # Bootstrap, scaffold, and L1/L2 skill wrappers
  skills/
    coreex-*/SKILL.md              # CoreEx skills, including coreex-file, with references/assets
  agents/
    coreex-expert.agent.md
  coreex-ai-workflows.md           # Command catalog and asset guidance
  docs/coreex/
    manifest.txt                  # Installed coreex-version
    *.md                          # 12 architecture/setup docs
    agents/*.md                   # 21 package guides
    files/*.md                    # File CodeGen configuration references and usage
    schema/coreex-files.json       # Release-matched File YAML schema
.claude/
  commands/
    coreex-bootstrap.md            # /coreex-bootstrap blank-repo initialisation command
    coreex-scaffold.md             # /coreex-scaffold guided solution scaffolding command
    coreex-expert.md               # /coreex-expert architecture guidance command
    coreex-docs-sync.md            # /coreex-docs-sync version-pinned AI bundle refresh
    coreex-*.md                   # L1/L2 skill wrappers, including coreex-file

--app-folder behaviour

When --app-folder is absent (single-repo), each instruction file retains its original scoped applyTo glob (e.g. applyTo: "**/*.cs"). When --app-folder is provided, each instruction file's applyTo glob is prefixed with the subfolder path (e.g. applyTo: "backend/**/*Validator*.cs"), keeping per-file instruction targeting while scoping Copilot context to that subfolder.

Examples

# Single-repo (most common — no args needed):
dotnet new coreex-ai

# Monorepo — CoreEx under backend/:
dotnet new coreex-ai --app-folder backend

# Monorepo — CoreEx under a nested path:
dotnet new coreex-ai --app-folder services/shopping

Template 2 -- coreex (Solution scaffold)

Scaffolds the shared solution core: the .slnx solution file, solution-wide configuration files (.editorconfig, Directory.Build.props, Directory.Packages.props), the Contracts, Application, Infrastructure class-library projects, and the Database and CodeGen tooling projects. The optional Domain project is a separate add-on — see "Template 3 -- coreex-domain" below.

Run this once per domain from the solution root directory.

Parameters

Parameter Type Default Description
-n / --name string (required) Solution base name, e.g. Avanade.Erp.Sales. Drives all file names and namespaces. Format: [Company].[Product].[Domain].
--refdata-enabled bool true Includes the reference-data pattern: IReferenceDataRepository (Application), ReferenceDataProvider (Application), ReferenceDataRepository (Infrastructure), and the CodeGen tool project.
--rop-enabled bool false Enables Railway-Oriented Programming -- Result/Result<T> return types throughout the solution.
--data-provider SqlServer | Postgres | Cosmos | None SqlServer The data persistence technology. SqlServer/Postgres use EF Core (DbContext/EfDb) with a DbEx Database tool project; Cosmos (Azure Cosmos DB) uses CoreEx.Cosmos directly (a [Domain]CosmosDb class, no EF Core, no SQL migrations) and provisions containers code-first from the Database tool project (ConfigureProvisionArgs plus seed data) -- a fresh solution ships a single ref-data container (when --refdata-enabled), with entity containers added later. None is for facade scenarios (e.g. over Dynamics 365) where there is no local database -- the Database tool project, data-access packages and persistence classes are all omitted.
--outbox-enabled bool true Includes transactional-outbox wiring in the Infrastructure project. Has no effect when --data-provider None.
--messaging-provider ServiceBus | None ServiceBus The messaging technology. None omits all messaging configuration.

Output

[name].slnx
.editorconfig
.gitignore
.filenesting.json
Directory.Build.props
Directory.Packages.props
src/
  [name].Contracts/
    [name].Contracts.csproj
    GlobalUsing.cs
  [name].Application/
    [name].Application.csproj
    GlobalUsing.cs
    ReferenceDataProvider.g.cs           (refdata-enabled only)
    Repositories/
      IReferenceDataRepository.cs        (refdata-enabled only)
  [name].Infrastructure/
    [name].Infrastructure.csproj
    GlobalUsing.cs
    Repositories/
      [Domain]DbContext.cs               (data-provider == SqlServer | Postgres)
      [Domain]EfDb.cs                    (data-provider == SqlServer | Postgres)
      [Domain]CosmosDb.cs                (data-provider == Cosmos -- the CosmosDb with the `ref-data` container and outbox event wiring)
      ReferenceDataRepository.cs         (refdata-enabled && data-provider != None)
tools/
  [name].Database/                       (data-provider != None; Cosmos: no dbex.yaml/Migrations -- containers are provisioned code-first)
    [name].Database.csproj
    Program.cs
  [name].CodeGen/                        (refdata-enabled && data-provider != None)
    [name].CodeGen.csproj
    Program.cs
    ref-data.yaml
tests/
  [name].Test.Common/
    [name].Test.Common.csproj
    TestData.cs
    ServiceBus.cs                        (messaging-provider == ServiceBus -- code-based topic/queue topology for tests; servicebus/Config.json is empty)
    GlobalUsing.cs                       (messaging-provider == ServiceBus)
    Data/                                (data-provider != None -- embedded seed data for DbEx / the Cosmos provisioner)
  [name].Test.Unit/
    [name].Test.Unit.csproj

Examples

Default (PostgreSQL, refdata, Service Bus outbox):

dotnet new coreex -n Avanade.Erp.Sales

PostgreSQL with no refdata:

dotnet new coreex -n Avanade.Erp.Sales --data-provider Postgres --refdata-enabled false

Facade over an external system (no local database or messaging):

dotnet new coreex -n Avanade.Erp.Sales --data-provider None --messaging-provider None

Domain-driven design with ROP, Postgres, no outbox:

dotnet new coreex -n Avanade.Erp.Sales --rop-enabled true --data-provider Postgres --outbox-enabled false
dotnet new coreex-domain -n Avanade.Erp.Sales.Domain
dotnet sln Avanade.Erp.Sales.slnx add src/Avanade.Erp.Sales.Domain
dotnet add src/Avanade.Erp.Sales.Application/Avanade.Erp.Sales.Application.csproj reference src/Avanade.Erp.Sales.Domain/Avanade.Erp.Sales.Domain.csproj

Template 3 -- coreex-domain (Domain layer add-on)

Scaffolds an optional *.Domain class-library project for solutions where domain complexity warrants domain-driven design: aggregate roots, child entities, value objects, and PersistenceState-driven mutation methods via CoreEx.DomainDriven. Most solutions do not need this -- add it only when the Application layer's CRUD-style orchestration is no longer enough.

Run this after coreex, from the solution root. Like coreex-api/coreex-relay/coreex-subscribe, this template requires the solution base name with its own suffix appended (e.g. Avanade.Erp.Sales.Domain, not the bare Avanade.Erp.Sales) -- passing the bare base name emits into the wrong folder and breaks the Contracts project reference. Unlike those hosts, coreex-domain does not add itself to the .slnx -- wire it in yourself with dotnet sln add. You must also add a project reference from Application to the new Domain project (dotnet add ... reference ...) -- Application is the only layer with a direct dependency on Domain (Infrastructure only reaches it transitively through Application), and nothing else wires that reference for you.

Parameters

Parameter Type Default Description
-n / --name string (required) Solution base name plus the .Domain suffix, e.g. Avanade.Erp.Sales.Domain.

Output

src/
  [name].Domain/
    [name].Domain.csproj
    GlobalUsing.cs

Example

dotnet new coreex -n Avanade.Erp.Sales --rop-enabled true --data-provider Postgres --outbox-enabled false
dotnet new coreex-domain -n Avanade.Erp.Sales.Domain
dotnet sln Avanade.Erp.Sales.slnx add src/Avanade.Erp.Sales.Domain
dotnet add src/Avanade.Erp.Sales.Application/Avanade.Erp.Sales.Application.csproj reference src/Avanade.Erp.Sales.Domain/Avanade.Erp.Sales.Domain.csproj

Template 4 -- coreex-api (API host)

Scaffolds an ASP.NET Core Web API host project. Wires up CoreEx execution context, optional reference-data orchestration, FusionCache L1/L2 caching with Redis backplane, the selected database provider and EF Core, outbox publishing, NSwag OpenAPI, and OpenTelemetry.

Run this from the solution root (the directory created by coreex). The template emits into both src/ and tests/ so it must be run at the root level.

Note: If --refdata-enabled true and *.CodeGen has already been run once (e.g. this host is being added to an existing solution), re-run dotnet run --project tools/[solution].CodeGen afterward. CodeGen only emits the reference-data controller into an *.Api project directory that exists at generation time -- it silently skips it (a log warning, not an error) for a host added later.

Parameters

Parameter Type Default Description
-n / --name string (required) Full project name, e.g. Avanade.Erp.Sales.Api. Must match the solution name with .Api appended.
--refdata-enabled bool true Wires up ReferenceDataOrchestrator and dynamic service registration for reference-data caching. Match the value used with coreex.
--data-provider SqlServer | Postgres | Cosmos | None SqlServer Database technology. Selects the Aspire connection, CoreEx database (or AddCosmosDb<T> for Cosmos), unit-of-work, health check and outbox publisher registration.
--outbox-enabled bool true Registers the outbox publisher (SqlServerOutboxPublisher, PostgresOutboxPublisher or CosmosDbEventPublisher) as the IEventPublisher. Has no effect when --data-provider None.

Output

src/
  [name].Api/
    [name].Api.csproj
    Program.cs
    GlobalUsing.cs
    appsettings.json
    appsettings.Development.json
    AGENTS.md
tests/
  [solution-name].Test.Api/
    [solution-name].Test.Api.csproj

appsettings.json (illustrative -- values are replaced at generation time):

{
  "CoreEx": {
    "Host": {
      "SolutionName": "Avanade.Erp",    // Company.Product (solution-parent-name)
      "DomainName": "Sales"              // Domain (domain-name)
    },
    "Events": {
      "Destination": "sales"             // Topic/queue name (domain-name-lower)
    }
  },
  "Logging": { ... }
}

appsettings.Development.json (connection strings vary by --data-provider):

{
  "Aspire": {
    // SQL Server (implement-sqlserver):
    "Microsoft": { "Data": { "SqlClient": { "ConnectionString": "Data Source=127.0.0.1,1433;Initial Catalog=Sales;..." } } },
    // OR PostgreSQL (implement-postgres):
    "Npgsql": { "ConnectionString": "Server=127.0.0.1;Database=sales;..." },
    // (Cosmos (implement-cosmos) uses a top-level "ConnectionStrings": { "Cosmos": "AccountEndpoint=https://localhost:8081/;AccountKey=..." } entry instead.)
    "StackExchange": { "Redis": { "ConnectionString": "localhost:6379" } }
  }
}

Examples

Default (PostgreSQL, refdata, outbox):

dotnet new coreex-api -n Avanade.Erp.Sales.Api

PostgreSQL, no refdata:

dotnet new coreex-api -n Avanade.Erp.Sales.Api --data-provider Postgres --refdata-enabled false

Facade (no database):

dotnet new coreex-api -n Avanade.Erp.Sales.Api --data-provider None

Template 5 -- coreex-relay (Outbox Relay host)

Scaffolds an ASP.NET Core background-service host that reads committed events from the transactional outbox table and forwards them to the messaging provider. Does not reference the solution's shared projects -- it is a standalone host that requires only a database connection and a messaging connection.

Run this from the solution root (the directory created by coreex). The template emits into both src/ and tests/ so it must be run at the root level.

Note: When --data-provider None is selected the outbox relay has nothing to relay. Scaffold this host only when your solution uses the outbox pattern (i.e. --data-provider is SqlServer, Postgres or Cosmos and --outbox-enabled true).

Parameters

Parameter Type Default Description
-n / --name string (required) Full project name, e.g. Avanade.Erp.Sales.Relay.
--data-provider SqlServer | Postgres | Cosmos | None SqlServer Database technology used for reading the outbox. For Cosmos the outbox is relayed from the Change Feed, one AddCosmosDbOutboxRelayHostedService("<container>") call per outbox-hosting container (a fresh solution ships ref-data).
--refdata-enabled bool true Cosmos only: a fresh Cosmos solution's only container is ref-data, so the relay hosted service (and its health checks/tests) are only emitted when this is true. Match the value used with coreex.
--messaging-provider ServiceBus | None ServiceBus Messaging provider to publish forwarded events to.

Output

src/
  [name].Relay/
    [name].Relay.csproj
    Program.cs
    appsettings.json
    appsettings.Development.json
    AGENTS.md
tests/
  [solution-name].Test.Relay/
    [solution-name].Test.Relay.csproj

appsettings.json (illustrative):

{
  "CoreEx": {
    "Host": {
      "SolutionName": "Avanade.Erp",
      "DomainName": "Sales",
      "Services": {
        "Interval": "00:00:00.500",
        "OutboxRelay": {
          "BatchSize": 10,
          "PerWorkerPartitionCount": 2,
          "LeaseDuration": "00:00:30",
          "BackoffDuration": "00:00:05",
          "ServicesCount": 4
        }
      }
    }
  }
}

For relational outbox hosts, configure CoreEx:Host:Outbox:PartitionSize identically in every API/Subscribe writer and Relay host. The default is 4 and the supported range is 1–256. The former relay-only CoreEx:Host:Services:OutboxRelay:PartitionSize key is removed; move its value to the shared Outbox:PartitionSize setting. When Service Bus sessions are used, CoreEx:Host:ServiceBus:SessionIdPartitionSize is an independent publisher-wide default (default 4), not coupled to the outbox partition count. Override a destination's SessionIdStrategy or bucket count under CoreEx:Host:ServiceBus:Destinations:{exact-destination-name} when its ordering/concurrency profile warrants it. This bucket count maps producer keys to sessions; the receiver's MaxConcurrentSessions independently controls consumer concurrency. See Service Bus session guidance.

appsettings.Development.json (connection strings vary by provider):

{
  "Aspire": {
    // SQL Server, PostgreSQL or Cosmos connection (same pattern as coreex-api)
    "Azure": {
      // implement-servicebus only:
      "Messaging": { "ServiceBus": { "ConnectionString": "Endpoint=sb://localhost;..." } }
    }
  }
}

Examples

SQL Server outbox -> Azure Service Bus:

dotnet new coreex-relay -n Avanade.Erp.Sales.Relay

PostgreSQL outbox -> Azure Service Bus:

dotnet new coreex-relay -n Avanade.Erp.Sales.Relay --data-provider Postgres

Cosmos DB outbox (Change Feed) -> Azure Service Bus:

dotnet new coreex-relay -n Avanade.Erp.Sales.Relay --data-provider Cosmos

Template 6 -- coreex-subscribe (Subscriber host)

Scaffolds an ASP.NET Core background-service host that receives events from a messaging provider, dispatches them through the CoreEx SubscribedManager, and processes them via subscriber implementations. Optionally includes reference-data caching and a database connection for subscriber logic that needs persistence.

Run this from the solution root (the directory created by coreex). The template emits into both src/ and tests/ so it must be run at the root level.

Parameters

Parameter Type Default Description
-n / --name string (required) Full project name, e.g. Avanade.Erp.Sales.Subscribe.
--refdata-enabled bool true Wires up ReferenceDataOrchestrator and dynamic service registration for reference-data caching. Match the value used with coreex.
--data-provider SqlServer | Postgres | Cosmos | None SqlServer Database technology. When not None, the data-access services (EF Core, or CoreEx.Cosmos) and, when --outbox-enabled, the outbox publisher are wired so subscriber logic can persist state and emit its own events.
--outbox-enabled bool true Registers the outbox publisher as the IEventPublisher (Service Bus is then a named, non-default publisher). When false, Service Bus is the default IEventPublisher. Match the value used with coreex.
--messaging-provider ServiceBus | None ServiceBus Messaging provider to receive events from. When None, no receiver is configured.

Output

src/
  [name].Subscribe/
    [name].Subscribe.csproj
    Program.cs
    GlobalUsing.cs
    appsettings.json
    appsettings.Development.json
    AGENTS.md
tests/
  [solution-name].Test.Subscribe/
    [solution-name].Test.Subscribe.csproj

appsettings.json (illustrative):

{
  "CoreEx": {
    "Host": {
      "SolutionName": "Avanade.Erp",
      "DomainName": "Sales",
      "Services": { "Interval": "00:00:00.500" }
    },
    "Events": {
      "Destination": "sales"             // Outbound event topic/queue (domain-name-lower)
    }
  }
}

appsettings.Development.json (connection strings vary by provider):

{
  "Aspire": {
    // SQL Server, PostgreSQL or Cosmos connection (same pattern as coreex-api)
    "Azure": {
      // implement-servicebus only:
      "Messaging": {
        "ServiceBus": {
          "ConnectionString": "Endpoint=sb://localhost;...",
          "QueueOrTopicName": "avanade.erp",   // solution-name-lower
          "SubscriptionName": "sales"           // domain-name-lower
        }
      }
    },
    "StackExchange": { "Redis": { "ConnectionString": "localhost:6379" } }
  }
}

Examples

Default (PostgreSQL, refdata, Service Bus):

dotnet new coreex-subscribe -n Avanade.Erp.Sales.Subscribe

PostgreSQL, no refdata:

dotnet new coreex-subscribe -n Avanade.Erp.Sales.Subscribe --data-provider Postgres --refdata-enabled false

Messaging only (no local database):

dotnet new coreex-subscribe -n Avanade.Erp.Sales.Subscribe --data-provider None

Template 7 -- coreex-aspire (Aspire AppHost)

Scaffolds a .NET Aspire AppHost project that orchestrates this solution's own Api/Relay/Subscribe hosts for local development, plus two sibling projects: [name].Aspire.MockHost (a WireMock.Net-based console host for stubbing external dependencies) and [solution-name].Test.Aspire (an NUnit project that spins up the whole AppHost via WithAspireTester<...> for smoke/integration testing). Dashboard sugar (health-check deep links, and "Pause all services"/"Resume all services" buttons for hosts running CoreEx hosted services) and Aspire test helpers come from the CoreEx.UnitTesting package (<Using Include="UnitTestEx" /> in [name].Aspire.csproj) -- there is no local Extensions.cs.

The generated HostTests require HTTP 200 OK from health endpoints. Startup 503 ServiceUnavailable responses are retried for up to 60 attempts with one-second delays; persistent unhealthiness or any other unexpected status fails the test rather than passing as endpoint reachability.

Run this from the solution root, after the host projects it will reference already exist. Unlike coreex-api/coreex-relay/coreex-subscribe, host inclusion is not derived from a shared coreex parameter -- pass --has-api/--has-relay/--has-subscribe explicitly to match whichever hosts this solution actually has. --data-provider/--messaging-provider should match the values used when scaffolding those hosts, so AppHost.cs declares the right connection-string resources.

Note: If a new host is added to the solution after coreex-aspire has already been run, don't re-run it with --force -- that would overwrite any customisation already made to AppHost.cs. Add the missing <ProjectReference> and builder.AddProject<...>(...) line by hand instead.

Parameters

Parameter Type Default Description
-n / --name string (required) Full project name, e.g. Avanade.Erp.Sales.Aspire.
--has-api bool true Include a project reference and AddProject<...> call for this solution's Api host.
--has-relay bool false Include a project reference and AddProject<...> call for this solution's Relay host.
--has-subscribe bool false Include a project reference and AddProject<...> call for this solution's Subscribe host.
--data-provider SqlServer | Postgres | Cosmos | None Postgres Database technology; determines which connection-string resource (SqlServer/Postgres/Cosmos) AppHost.cs declares and each host references.
--messaging-provider ServiceBus | None ServiceBus Messaging technology; determines whether AppHost.cs declares a ServiceBus connection-string resource for the Relay/Subscribe hosts.

Output

aspire/
  [name].Aspire/
    [name].Aspire.csproj
    AppHost.cs
    appsettings.json
    appsettings.Development.json
    Properties/launchSettings.json
    AGENTS.md
  [name].Aspire.MockHost/
    [name].Aspire.MockHost.csproj
    Program.cs
  [solution-name].Test.Aspire/
    [solution-name].Test.Aspire.csproj
    GlobalUsing.cs
    HostTests.cs

AppHost.cs (illustrative, all three hosts included, Postgres + Service Bus):

var builder = DistributedApplication.CreateBuilder(args);

if (builder.Environment.IsDevelopment())
    builder.DisableHttpCertificateValidation();

var db = builder.AddExternalConnectionString("Postgres").WithIconName("DatabaseMultiple");
var redis = builder.AddExternalConnectionString("redis").WithIconName("Database");
var serviceBus = builder.AddExternalConnectionString("ServiceBus").WithIconName("MailMultiple");

// Sales domain.
builder.AddProject<Projects.Avanade_Erp_Sales_Api>("sales-api").WithReference(db).WithReference(redis).AddEndpoints("/health/ready/detailed");
builder.AddProject<Projects.Avanade_Erp_Sales_Relay>("sales-relay").WithReference(db).WithReference(serviceBus).AddEndpoints("/health/ready/detailed").AddHostedServiceSupport();
builder.AddProject<Projects.Avanade_Erp_Sales_Subscribe>("sales-subscribe").WithReference(db).WithReference(redis).WithReference(serviceBus).AddEndpoints("/health/ready/detailed").AddHostedServiceSupport();

builder.Build().Run();

The certificate-validation bypass is enabled only when the AppHost's resolved hosting environment is Development, as configured by the generated launch profiles. It supports HTTPS project endpoints with untrusted development certificates, including Linux CI test runs; all other environments retain normal certificate validation. It applies to clients created by the AppHost's IHttpClientFactory, not to clients in the separately hosted services. An HTTP MockHost does not need a certificate bypass. The guard is not Linux-specific.

AddExternalConnectionString is supplied by CoreEx.UnitTesting in the UnitTestEx namespace, alongside AddEndpoints and the other Aspire helpers; there is no local implementation. It wraps secret parameters from ConnectionStrings:{name} in visible ConnectionStringResource nodes. Aspire 13.5.4 excludes parameter-only AddConnectionString(name) resources from Graph/Table views. Existing connection names and host references are preserved; Compose still owns the actual infrastructure lifecycle. The template-pack validation checks generated connection-string defaults. The generated AppHost has a UserSecretsId; use dotnet user-secrets set "ConnectionStrings:Postgres" "<connection-string>" --project aspire/[solution].Aspire/[solution].Aspire.csproj to override a local development value without committing credentials. A node's running status means configuration resolved, not that its service is healthy; host readiness checks perform those probes.

For Cosmos the scaffold passes endpointKey: "AccountEndpoint" and derives a credential-free resource URL from that connection string, correcting dashboard peer matching. Relational connection strings should include explicit ports. Shared localhost addresses and missing span ports can still cause misattribution; inspect server.address, server.port, and peer.service rather than treating a dashboard label as proof of provider wiring. For an existing AppHost, update its pinned CoreEx package version and resource declarations manually; do not overwrite custom wiring with dotnet new coreex-aspire --force.

Examples

API only:

dotnet new coreex-aspire -n Avanade.Erp.Sales.Aspire --has-api true

Full event-driven (API + Relay + Subscribe):

dotnet new coreex-aspire -n Avanade.Erp.Sales.Aspire --has-api true --has-relay true --has-subscribe true --data-provider Postgres --messaging-provider ServiceBus

Default Workflow Correlation

The API, Relay and Subscribe templates place exception handling before UseExecutionContext() so configuration failures receive standard error conversion. Execution precedes HTTPS redirection and authorization so optional X-Correlation-Id capture and response echo cover early exits; its registered response callback also echoes correlation on handled errors. Framework exception logs are outside the execution's correlation scope. The Functions template already enables UseCoreExExecutionContext(); HTTP correlation becomes active when the ASP.NET-integrated HTTP capability is added. Console formatter scopes are enabled in all four host templates, and OpenTelemetry logging options include scopes without adding an exporter to the empty Functions host. Missing correlation stays null; no identifier is generated. CoreEx named/typed clients propagate correlation, events snapshot it at creation, and message receive processing imports stored correlation. The custom span attribute is correlation.id; batch publishing spans omit it. Browser CORS allowance/exposure remains an explicit application decision.

Template 8 -- coreex-functions (Empty Functions host)

Scaffolds one independently deployable Azure Functions isolated-worker app and its corresponding test project into an existing CoreEx solution. The host initializes CoreEx execution context and references the shared Application/Infrastructure libraries, but deliberately contains no functions, health endpoint, cache, database, broker connection or telemetry exporter. It does not automatically scan/register application services: add those registrations with their dependencies when a capability needs them, so unused services cannot prevent the empty host from starting. The test project references the host and includes UnitTestEx Functions, CoreEx test helpers, NUnit and AwesomeAssertions, without invented test cases. Trigger-specific registrations and meaningful tests belong with the first real capability.

Run from the solution root with the full host name ending in .Functions. By default, the host references shared layers; use --shared-core false for a standalone integration app without those projects or a preceding dotnet new coreex. Unlike the other host templates, a separate --solution-name can select shared layers independently of the deployment name. Multiple Functions hosts can reuse the same layers without referencing one another or overwriting shared settings.

Parameters

Parameter Type Default Description
-n / --name string (required) Full host name, e.g. Avanade.Erp.Sales.Functions or Avanade.Erp.Sales.Imports.Functions.
--shared-core bool true Reference shared Application/Infrastructure projects; false uses capability-local processing. Package policy is independent.
--solution-name string Host name without its final segment Shared Application/Infrastructure project prefix, e.g. Avanade.Erp.Sales. Specify this for an additional workload segment or independently named host. In both modes it supplies the solution/domain identity in the host's worker configuration; standalone mode never references those projects.
--test-common-project string (empty) Optional Test.Common .csproj path relative to the generated test project; independent of host/shared-library naming. A supplied missing path fails explicitly.

Output

src/
  [name]/
    [name].csproj
    Program.cs
    GlobalUsing.cs
    appsettings.json
    host.json
    local.settings.json
    .gitignore
    AGENTS.md
tests/
  [host-prefix].Test.Functions/
    [host-prefix].Test.Functions.csproj
    GlobalUsing.cs
    .gitignore

Both modes follow effective MSBuild package policy: central versions when ManagePackageVersionsCentrally is true, otherwise inline versions pinned by the template. Explicit MSBuild opt-outs remain supported. New coreex and coreex-solution scaffolds include CoreEx.Azure.Functions, Worker.Sdk and UnitTestEx Functions versions. Older CPM solutions need the missing entries merged into their existing catalogue, retaining compatible pins; do not regenerate root policy. The Functions package brings HTTP/Service Bus support transitively but the empty template enables no triggers.

--shared-core false retains self-contained .NET 10/nullable/implicit-using settings, but no longer disables repository CPM. Raw host generation without root props remains supported and uses inline versions. The host template never writes root policy or a solution file. Standalone means no shared business-library dependencies, not no solution hygiene.

--test-common-project wires an explicitly selected common library into the test project only. /coreex-scaffold discovers it and supplies the relative path for newly generated tests; existing test projects use dotnet add <test-project> reference <common-project>. Creating Test.Common or registering it in .slnx does not add a ProjectReference automatically.

When the SDK supports --include-references, pass --include-references false when registering projects whose dependencies are already in the solution. .NET 11 otherwise recursively adds references and may collide with the existing Test.Common project.

local.settings.json contains only FUNCTIONS_WORKER_RUNTIME=dotnet-isolated, is ignored by Git and is never published. Add required binding settings and storage configuration when choosing actual triggers; no emulator or secret is assumed. The worker's appsettings.json is not a replacement for Functions host/listener app settings.

Examples

# Standard host using the shared Avanade.Erp.Sales layers.
dotnet new coreex-functions -n Avanade.Erp.Sales.Functions

# A second independently deployable app sharing those same layers.
dotnet new coreex-functions -n Avanade.Erp.Sales.Imports.Functions --solution-name Avanade.Erp.Sales

dotnet sln Avanade.Erp.Sales.slnx add src/Avanade.Erp.Sales.Functions --solution-folder hosts --include-references false
dotnet sln Avanade.Erp.Sales.slnx add src/Avanade.Erp.Sales.Imports.Functions --solution-folder hosts --include-references false
dotnet sln Avanade.Erp.Sales.slnx add tests/Avanade.Erp.Sales.Test.Functions --solution-folder tests --include-references false
dotnet sln Avanade.Erp.Sales.slnx add tests/Avanade.Erp.Sales.Imports.Test.Functions --solution-folder tests --include-references false
dotnet build tests/Avanade.Erp.Sales.Test.Functions
dotnet build tests/Avanade.Erp.Sales.Imports.Test.Functions

Standalone integration with a repository/test baseline (no full coreex scaffold required):

dotnet new coreex-solution -n Avanade.Integration
dotnet new coreex-functions -n Avanade.Integration.Imports.Functions --shared-core false --test-common-project "..\Avanade.Integration.Test.Common\Avanade.Integration.Test.Common.csproj"
dotnet sln Avanade.Integration.slnx add src/Avanade.Integration.Imports.Functions --solution-folder hosts --include-references false
dotnet sln Avanade.Integration.slnx add tests/Avanade.Integration.Imports.Test.Functions --solution-folder tests --include-references false
dotnet build tests/Avanade.Integration.Imports.Test.Functions
# Add real functions and their tests before running the test project.

One project is one Function App deployment/configuration/identity boundary. Split hosts for operational isolation, permissions, ownership or deployment cadence; do not automatically split by trigger type.

Add capability folders when needed, for example Imports/ImportFunction.cs with its local transport types. Normally use one trigger class per file; related HTTP methods can share a class. Keep trigger methods thin: use shared Application/Infrastructure services when those layers exist, or focused capability-local handlers such as Imports/BlobForwarder.cs for a standalone integration. Extract libraries when actual reuse or complexity warrants them, not just for layering ceremony. Mirror capability folders in the generated test project and add UnitTestEx invocation tests with the first real function. Test project names replace the host's final .Functions with .Test.Functions, independently of --solution-name; Sales.Imports.Functions therefore gets Sales.Imports.Test.Functions without colliding with Sales.Test.Functions. Runtime binding/delivery assertions require Core Tools/Aspire rather than invocation tests alone.

For HTTP functions, add ConfigureFunctionsWebApplication() immediately after builder creation, register AddMvc()/AddMvcWebApi() and use the existing MVC WebApi; do not copy ASP.NET middleware or MapHealthChecks into Functions. For Service Bus/Blob/Timer, add only the binding/configuration the workload needs. See CoreEx.Azure.Functions for executable examples and the Functions-owned retry/settlement boundaries.


Template 9 -- coreex-solution (Repository and shared-test baseline)

Supplies a named .slnx, Directory.Build.props, Directory.Packages.props, tests/Directory.Build.props, .editorconfig, .gitattributes, .gitignore, .filenesting.json, README/AGENTS/CLAUDE guidance, and lightweight Test.Common by default. It shares canonical root policy and the TestData resource marker with the full scaffold at pack time. It generates no runtime host, business libraries, database, broker topology or sample tests.

Parameter Type Default Description
-n / --name string (required) Actual solution name; no three-part domain requirement.
--test-common bool true Create/register tests/[name].Test.Common; false yields root artefacts only.

Test.Common is non-packable and not a discoverable test suite. It supports authored embedded Data//Resources/ and shared helpers, with no Database reference, ServiceBus SDK imports or seeded database fixtures. Consuming test projects need explicit references; runtime/CodeGen projects must not reference it.

Central CodeGen/IO version entries are available independently of data/ref-data flags. Unused PackageVersion entries do not introduce dependencies or enable features.

For a populated repository, use the scaffold retrofit workflow: generate into a separate temporary directory, merge reviewed missing artefacts, preserve every existing pin/alias during CPM migration, then register existing projects and wire their common references. A plain template invocation does not migrate existing .csproj files. Never force over an existing root or regenerate the host. The full coreex scaffold already owns a baseline; do not apply both root-emitting templates to one solution.


Template 10 -- coreex-codegen (Independent design-time console)

Run dotnet new coreex-codegen -n Avanade.Integration.CodeGen from the solution root to create tools/Avanade.Integration.CodeGen/ with its console project, entry point, GlobalUsing and usage guidance. Register it under tools using the solution CLI. The console is non-packable, references CoreEx.CodeGen only, follows effective CPM/inline policy, and returns the generator's exit code.

Reuse existing CodeGen tooling where present. No database, reference data, business layers, runtime ProjectReference or dummy schema is generated. File definitions select an existing runtime project using runtimeProjectPath; that project needs CoreEx.IO/CoreEx.Validation. Keep generated artefacts out of manual edits and preserve handwritten handlers.

Run from the CodeGen project directory:

dotnet run -- file --validate
dotnet run -- file
dotnet run -- file --expect-no-changes

The unchanged default command is RefData, requiring an authored ref-data.yaml. File uses top-level *-file.yaml and explicit file; dotnet run --project does not change discovery's working directory. Use /coreex-file for definitions and /coreex-functions for the native Functions trigger boundary. No generator-package split is needed.

An empty host may report "No job functions found" until its first trigger is added. This is intentional. Health functions are optional operational capabilities, not generated workload. Use /coreex-functions from the version-pinned coreex-ai bundle to add actual HTTP/Service Bus/Blob/Timer capabilities, their packages/configuration and meaningful UnitTestEx tests; its scoped instructions keep native Functions boundaries distinct from ASP.NET hosts.


Typical Workflow

These templates are independent -- use only the ones your solution needs (an optional coreex-domain add-on can be scaffolded after Step 1 when DDD complexity warrants it; see the coreex-domain template above). The following shows a full event-driven microservice topology:

Step 1 -- Create the solution root

mkdir Avanade.Erp.Sales
cd Avanade.Erp.Sales
dotnet new coreex -n Avanade.Erp.Sales

Produces the .slnx, solution configuration files, src/ class libraries, tools/ projects, and tests/ (Test.Common + Test.Unit). The current directory becomes the solution root.

Step 2 -- Scaffold host projects

Run from the solution root. Each template emits into both src/ and tests/:

dotnet new coreex-api        -n Avanade.Erp.Sales.Api
dotnet new coreex-relay      -n Avanade.Erp.Sales.Relay
dotnet new coreex-subscribe -n Avanade.Erp.Sales.Subscribe

Step 3 -- Add hosts and their test projects to the solution

dotnet sln Avanade.Erp.Sales.slnx add src/Avanade.Erp.Sales.Api --solution-folder hosts
dotnet sln Avanade.Erp.Sales.slnx add tests/Avanade.Erp.Sales.Test.Api --solution-folder tests

dotnet sln Avanade.Erp.Sales.slnx add src/Avanade.Erp.Sales.Relay --solution-folder hosts
dotnet sln Avanade.Erp.Sales.slnx add tests/Avanade.Erp.Sales.Test.Relay --solution-folder tests

dotnet sln Avanade.Erp.Sales.slnx add src/Avanade.Erp.Sales.Subscribe --solution-folder hosts
dotnet sln Avanade.Erp.Sales.slnx add tests/Avanade.Erp.Sales.Test.Subscribe --solution-folder tests

Step 4 -- Add an Aspire AppHost (optional)

Once the hosts above exist, optionally scaffold an AppHost for local orchestration:

dotnet new coreex-aspire -n Avanade.Erp.Sales.Aspire --has-api true --has-relay true --has-subscribe true --data-provider SqlServer --messaging-provider ServiceBus
dotnet sln Avanade.Erp.Sales.slnx add aspire/Avanade.Erp.Sales.Aspire
dotnet sln Avanade.Erp.Sales.slnx add aspire/Avanade.Erp.Sales.Aspire.MockHost
dotnet sln Avanade.Erp.Sales.slnx add aspire/Avanade.Erp.Sales.Test.Aspire

Resulting filesystem and solution structure

Host project directories stay under the physical src/ directory, while their projects are grouped under the virtual /hosts/ solution folder. Test projects stay under physical tests/ and virtual /tests/. These solution folders only organize the IDE view; they do not move files on disk.

Avanade.Erp.Sales/
  Avanade.Erp.Sales.slnx
  .editorconfig  |  .gitignore  |  Directory.Build.props  |  Directory.Packages.props
  src/
    Avanade.Erp.Sales.Contracts/
    Avanade.Erp.Sales.Application/
    Avanade.Erp.Sales.Infrastructure/
    Avanade.Erp.Sales.Api/
    Avanade.Erp.Sales.Relay/
    Avanade.Erp.Sales.Subscribe/
  tools/
    Avanade.Erp.Sales.Database/
    Avanade.Erp.Sales.CodeGen/
  tests/
    Avanade.Erp.Sales.Test.Common/
    Avanade.Erp.Sales.Test.Unit/
    Avanade.Erp.Sales.Test.Api/
    Avanade.Erp.Sales.Test.Relay/
    Avanade.Erp.Sales.Test.Subscribe/
  aspire/
    Avanade.Erp.Sales.Aspire/
    Avanade.Erp.Sales.Aspire.MockHost/
    Avanade.Erp.Sales.Test.Aspire/

In the solution explorer, the host projects appear under /hosts/; the source libraries remain under /src/, tools under /tools/, and tests under /tests/.


Scenario Examples

Full event-driven (SQL Server, Service Bus, refdata)

All defaults -- no flags required:

dotnet new coreex            -n Avanade.Erp.Sales
dotnet new coreex-api        -n Avanade.Erp.Sales.Api
dotnet new coreex-relay      -n Avanade.Erp.Sales.Relay
dotnet new coreex-subscribe -n Avanade.Erp.Sales.Subscribe
dotnet new coreex-aspire     -n Avanade.Erp.Sales.Aspire --has-api true --has-relay true --has-subscribe true --data-provider SqlServer --messaging-provider ServiceBus

Cosmos DB variant

Cosmos needs no SQL migrations; the Database tool provisions the ref-data container code-first (and the test projects do the same against the emulator).

dotnet new coreex           -n Avanade.Erp.Sales --data-provider Cosmos
dotnet new coreex-api       -n Avanade.Erp.Sales.Api        --data-provider Cosmos
dotnet new coreex-relay     -n Avanade.Erp.Sales.Relay      --data-provider Cosmos
dotnet new coreex-subscribe -n Avanade.Erp.Sales.Subscribe  --data-provider Cosmos
dotnet new coreex-aspire    -n Avanade.Erp.Sales.Aspire --has-api true --has-relay true --has-subscribe true --data-provider Cosmos --messaging-provider ServiceBus

PostgreSQL variant

dotnet new coreex            -n Avanade.Erp.Sales --data-provider Postgres
dotnet new coreex-api        -n Avanade.Erp.Sales.Api        --data-provider Postgres
dotnet new coreex-relay      -n Avanade.Erp.Sales.Relay      --data-provider Postgres
dotnet new coreex-subscribe -n Avanade.Erp.Sales.Subscribe --data-provider Postgres

Facade over an external system (e.g. Dynamics 365)

No local database, no outbox, no messaging infrastructure -- the API is a pure HTTP facade:

dotnet new coreex     -n Avanade.Erp.Sales --data-provider None --messaging-provider None
dotnet new coreex-api -n Avanade.Erp.Sales.Api --data-provider None

No relay or subscriber needed -- omit those templates entirely.

API + Subscriber only (no outbox relay)

When using an at-least-once messaging pattern without transactional outbox:

dotnet new coreex            -n Avanade.Erp.Sales --outbox-enabled false
dotnet new coreex-api        -n Avanade.Erp.Sales.Api        --outbox-enabled false
dotnet new coreex-subscribe -n Avanade.Erp.Sales.Subscribe

Package Design Notes

Single install, seven project-scaffolding templates. All seven ship inside the same NuGet package as coreex-ai (PackageType=Template). A single dotnet new install CoreEx.Template::<version> makes all short names available: coreex, coreex-domain, coreex-api, coreex-relay, coreex-subscribe, coreex-aspire, and coreex-functions.

Version stamping. During dotnet pack, the inline MSBuild ReplaceTextInFile task stamps the actual $(Version) into generated copies of the eight template.json files carrying COREEX_VERSION: Ai, Core, Api, Relay, Subscribe, Functions, Solution and CodeGen. Source copies retain the placeholder. Domain and Aspire have no version token and are packed directly. Functions and independent CodeGen use the stamped pin when effective CPM is disabled; shared-core does not choose package policy.

Central Package Management. By default, generated PackageReference entries carry no Version attribute -- versions are resolved from the Directory.Packages.props emitted by the coreex solution template. These hosts require that shared solution configuration first. coreex-aspire uses a per-project VersionOverride for its extra MessagePack CVE override rather than updating the root file. coreex-functions --shared-core false explicitly opts its host and test projects out of CPM and supplies their package versions locally, requiring no shared solution configuration.

Conditional file exclusion. The template engine's sources.modifiers with glob patterns handle all conditional file output -- no empty placeholder files are emitted. The .slnx solution file uses specialCustomOperations to enable <!--#if--> XML-style conditionals (the template engine does not recognise .slnx as XML by default).

preferNameDirectory. All seven project-scaffolding templates set preferNameDirectory: false so they generate into the current directory rather than creating an extra named subdirectory. The solution template generates its content directly into the current directory. Host templates generate their content into src/[ProjectName]/ and tests/ subdirectories, which are created by the template itself as part of the source layout -- not by the preferNameDirectory mechanism. Aspire uses aspire/.

solution-name file renaming. The Api/Relay/Subscribe host templates use a solution-name derived symbol (everything before the last dot-segment of the -n value) with fileRename: "solution-name". This substitutes directory names like solution-name.Test.Api at generation time, producing correctly-named test project folders (e.g. Avanade.Erp.Sales.Test.Api). Functions resolves a separately overridable shared solution name for layer references; host and test output paths derive independently from the full host name.

Validating Template Changes

dotnet build/dotnet test on CoreEx.sln never compiles anything under content/ -- it's raw dotnet new template source, not a C# project. A change to a host's Program.cs, GlobalUsing.cs, .csproj, or a template.json symbol is only proven correct by actually scaffolding it and building the result. Run ../../tools/validate-template-pack.ps1 (also run in CI) -- it packs and installs the template, scaffolds every parameter combination in its $testScenarios array into temp directories, asserts expected file presence/content, and dotnet builds the scenarios flagged Build = $true.

Local validation builds and packs libraries for .NET 10 in Debug, including when CoreExLocalTargetFramework is unset; the source generator retains its required netstandard2.0 target. CI (CI=true) retains full-framework Release library packages. Generated scenarios build/test .NET 10 in Debug in both environments. -NoRebuild uses the existing template package from the corresponding Debug/Release directory. These reduced local packages are validation artifacts, not release packages.

When adding a template, a host, or a new parameter, add a matching scenario. Most existing host-template scenarios (coreex-api-*, coreex-relay-*, coreex-subscribe-*) scaffold in isolation and set Build = $false because they have no coreex-generated siblings to compile against -- so a symbol-conditional bug (an unconditional global using/ProjectReference that should have been gated behind has-data-provider, implement-servicebus, etc.) will only be caught by a scenario that scaffolds coreex plus the host together in the same directory and builds the host's own .csproj.

Additional Resources

  • CoreEx -- The framework these templates scaffold for.
  • CoreEx.CodeGen -- The reference-data code-generation tool project scaffolded by the coreex template when --refdata-enabled true.
  • dotnet templating wiki -- Full reference for template.json configuration.