"Wire a change into a CoreEx Aspire AppHost and its Test.Aspire end-to-end project. USE FOR: adding a host to the AppHost, adding a Service Bus queue/topic to the Test.Aspire topology, wiring an inter-domain HTTP dependency (service discovery), stubbing a third-party or out-of-AppHost HTTP dependency via the MockHost, and writing a cross-host E2E test (OnBeforeStartAsync / OnAfterStartAsync, polling async effects). DO NOT USE FOR: starting/stopping/debugging a running AppHost (use the aspire skill), intra-domain host tests (use coreex-test-api / coreex-test-subscribe / coreex-test-relay), the initial AppHost scaffold (use coreex-scaffold), or the typed HTTP client / adapter itself (use coreex-adapter)."
Resources
1Install
npx skillscat add avanade/coreex/coreex-aspire Install via the SkillsCat registry.
CoreEx: Aspire Wiring & E2E
Makes a code change visible and testable in the Aspire environment: AppHost resources and references, MockHost stubs for anything outside the AppHost, the code-based Service Bus topology, and a cross-host E2E test. Aspire is where inter-domain dependencies are real — everything intra-domain tests deliberately mock is exercised here.
When to Use
- A new Api / Relay / Subscribe host must join the AppHost
- A change introduces a Service Bus queue (e.g. a command queue) that the E2E topology must create
- A new queue/topic needs session requirements or a destination-specific producer session profile
- A host now calls another domain's HTTP API (needs service discovery) or a third-party API (needs a MockHost stub)
- A cross-host flow needs an automated E2E test (
*.Test.Aspire) - Invoked by `coreex-command-publish-e2e` and `coreex-command-subscribe-e2e` for their final step
When Not to Use
- Running / stopping / inspecting a live AppHost (logs, traces, resource status) — use the
aspireskill - Intra-domain tests —
coreex-test-api,coreex-test-subscribe,coreex-test-relay - Generating the AppHost for the first time —
coreex-scaffold(dotnet new coreex-aspire) - Writing the typed HTTP client / adapter —
coreex-adapter(this skill only wires it into Aspire)
Resolve project-wide choices from state before asking. Read the solution-root
AGENTS.mdFeature Configuration
(data-provider,messaging-provider,outbox-enabled) and inspect the existing*.Aspire/AppHost.cs,*.Aspire.MockHost
and*.Test.Aspirebefore interviewing. Re-state resolved values for confirmation.
The Deciding Question — where does the callee live?
| Callee | Mechanism | Stub in Test.Aspire? |
|---|---|---|
| Another domain in the same AppHost | .WithReference(calleeApi) on each caller + BaseAddress = https+http://{resource-name} |
No — real call |
| A third-party API | MockHost + .WithMockHostEnvironment("Section__BaseAddress", mockhost, "http") |
Yes — app.HttpMock(...) in OnAfterStartAsync |
| Another domain outside this AppHost | Same as third-party | Yes |
Get this wrong and the E2E either hides a real integration (stubbing an in-AppHost domain) or hits the internet (not stubbing a third party).
Workflow Overview
- Inspect — read AppHost, MockHost, Test.Aspire, Test.Common
ServiceBus, the calling host'sProgram.cs+appsettings.Development.json. - Interview — what changed; where each callee lives; which async effect the E2E should prove.
- AppHost — add/adjust visible external resources via
CoreEx.UnitTesting'sAddExternalConnectionString,AddProject+WithReference(+ProjectReference); service-discoveryBaseAddress; MockHost wiring. - Topology — add queues/topics/subscriptions to the
ServiceBusclass used by Test.Aspire (union class if multi-domain); mark session-enabled entities withRequiresSession = trueand check the producer's exact destination-specific session profile. - Test.Aspire —
OnBeforeStartAsync(migrate, cache, broker reset) /OnAfterStartAsync(wait, stubs); E2E test with bounded polling. - Validate —
dotnet buildthe AppHost + Test.Aspire;dotnet testwhen infrastructure is up.
For step-by-step guidance see `references/workflow.md`.
Key References
- `/.github/instructions/coreex-aspire.instructions.md` — AppHost / MockHost / Test.Aspire invariants
- `/.github/instructions/coreex-tests.instructions.md` — intra-domain test conventions (what Aspire deliberately does not re-cover)
- `/.github/instructions/coreex-host-setup.instructions.md` —
AddTypedHttpClient, receivers,Program.cs - Related skills: `coreex-adapter` (typed HTTP client), `coreex-scaffold` (AppHost scaffold)
- Aspire & End-to-End — optional (after
/coreex-docs-sync) - Illustrative examples (CoreEx sample — not present in your project): `AppHost.cs`, `E2ETest.cs`, `ServiceBus.cs`