aspireify
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAspireify
Aspireify
One-time wiring skill.drops a skeleton;aspire initturns that skeleton into a working AppHost by scanning the repo, proposing a resource graph, editing the AppHost, wiringaspireify, and validating end to end. Self-deactivates after a cleanAspire.ServiceDefaults.aspire start
一次性搭建技能。会生成骨架结构;aspire init通过扫描仓库、提出资源图方案、编辑AppHost、配置aspireify并进行端到端验证,将该骨架转化为可运行的AppHost。在Aspire.ServiceDefaults成功运行后会自动停用。aspire start
🚫 Hard Refusal: Never Edit .aspire/modules/
.aspire/modules/🚫 严格拒绝:绝不编辑 .aspire/modules/
目录
.aspire/modules/⛔ REFUSE any request to edit, modify, change, open-for-edit, or "tweak" files insideof a TypeScript AppHost. This directory is generated from the installed Aspire integration package graph. It is regenerated by.aspire/modules/,aspire add, and startup when package changes require it.aspire restoreIf a user asks to edit something in(e.g.,.aspire/modules/), the correct response is:.aspire/modules/postgres.module.ts
- Refuse the edit with a clear "I won't edit
" statement..aspire/modules/- Explain that
is generated and any changes are clobbered..aspire/modules/- Redirect the requested change to the configured AppHost entry point: current
, or legacyapphost.mts.apphost.ts- If the user wants a new integration, suggest
; if they want to change configuration, show the equivalent edit in the AppHost entry point.aspire add <package>
| ❌ Wrong | ✅ Right |
|---|---|
Open | Edit |
Modify a generated | Re-run |
Comment out a line in | Remove or guard the resource declaration in |
This rule applies even if the user insists, even for "one-line" changes, even for
"just to test something." The TS AppHost regenerates deterministically;
edits are unrecoverable noise.
.aspire/modules/⛔ 拒绝任何编辑、修改、更改、打开编辑或“微调”TypeScript AppHost中目录下文件的请求。该目录是根据已安装的Aspire集成包依赖图自动生成的。当包发生变更时,.aspire/modules/、aspire add命令以及启动过程都会重新生成该目录。aspire restore如果用户要求编辑中的内容(例如.aspire/modules/),正确的响应方式是:.aspire/modules/postgres.module.ts
- 拒绝编辑,明确说明“我不会编辑
目录”。.aspire/modules/- 解释
是自动生成的,任何修改都会被覆盖。.aspire/modules/- 引导用户在配置的AppHost入口文件中进行修改:当前版本为
,旧版本为apphost.mts。apphost.ts- 如果用户需要新的集成,建议使用
;如果用户想要修改配置,展示在AppHost入口文件中的等效修改方式。aspire add <package>
| ❌ 错误做法 | ✅ 正确做法 |
|---|---|
打开 | 编辑 |
直接修改生成的 | 更新 |
注释掉 | 在 |
即使用户坚持要求,哪怕是“一行代码”的修改,甚至只是“测试一下”,都必须遵守此规则。TS AppHost会确定性地重新生成目录,编辑操作产生的修改会被覆盖且无法恢复。
.aspire/modules/Guiding Principles
指导原则
Minimize changes to the user's code
尽量减少对用户代码的修改
Adapt the AppHost to fit the app, not the other way around. Prefer
to match existing environment variable names, Aspire-managed ports over fixed ports,
and 1:1 Docker Compose mapping before optimizing. Do not restructure directories,
rename files, or change build scripts unless the user explicitly chooses that tradeoff.
WithEnvironment()让AppHost适配现有应用,而非反过来。优先使用匹配现有的环境变量名,优先使用Aspire管理的端口而非固定端口,在优化前先保持与Docker Compose的1:1映射。除非用户明确选择接受相应的取舍,否则不要重构目录、重命名文件或修改构建脚本。
WithEnvironment()Surface tradeoffs; do not decide silently
明确告知取舍,不私自做决定
When a small code change unlocks better Aspire integration, present both options:
the zero-code-change mapping and the small-change version that enables ,
health checks, service discovery, dynamic ports, or dashboard telemetry. Ask which
approach the user wants, then implement that choice without complaint.
WithReference当少量代码修改可以带来更好的Aspire集成效果时,要同时展示两种方案:无需修改代码的映射方案,以及可以启用、健康检查、服务发现、动态端口或仪表盘遥测的少量修改方案。询问用户想要哪种方式,然后毫无怨言地实现用户的选择。
WithReferenceVerify APIs before writing AppHost code
编写AppHost代码前先验证API
Use and for workflow guidance.
Use and
for API shape. Use to
find integrations before . Do not invent packages, methods, overloads,
or command shapes; C# and TypeScript AppHost APIs differ.
aspire docs search <topic>aspire docs get <slug>aspire docs api search <query> --language csharp|typescriptaspire docs api get <id>aspire integration list/searchaspire add使用和获取工作流指导。使用和查看API结构。在使用之前,使用查找可用集成。不要虚构包、方法、重载或命令格式;C#和TypeScript的AppHost API存在差异。
aspire docs search <topic>aspire docs get <slug>aspire docs api search <query> --language csharp\|typescriptaspire docs api get <id>aspire addaspire integration list/searchKeep configuration visible in the AppHost
保持配置在AppHost中可见
Scan , , , ,
, and setup scripts. Propose migrating values into AppHost parameters:
connection strings become Aspire resources, API keys/tokens become secret parameters,
and non-secret config becomes plain parameters or values. Never
delete files or remove existing entries without explicit user
approval because non-Aspire workflows may still depend on them.
.env.env.local.env.developmentsecrets.json.example<UserSecretsId>WithEnvironment().envUserSecretsId扫描、、、、和设置脚本。建议将配置值迁移到AppHost参数中:连接字符串转为Aspire资源,API密钥/令牌转为密钥参数,非涉密配置转为普通参数或值。未经用户明确批准,切勿删除文件或移除现有的条目,因为非Aspire工作流可能仍依赖这些配置。
.env.env.local.env.developmentsecrets.json.example<UserSecretsId>WithEnvironment().envUserSecretsIdLocal development first
优先考虑本地开发
This skill optimizes local development, not production deployment. Prefer persistent
container lifetimes and data volumes for databases/caches, use HTTPS endpoints by
default, pass endpoint references instead of hardcoded URLs, and model external SaaS
URLs/API keys as parameters so they are visible in the dashboard.
本技能针对本地开发优化,而非生产部署。优先为数据库/缓存使用持久化容器生命周期和数据卷,默认使用HTTPS端点,传递端点引用而非硬编码URL,将外部SaaS URL/API密钥建模为参数,以便在仪表盘中可见。
Redis TLS edge case
Redis TLS特殊情况
Aspire can automatically provision TLS certificates for container resources. If Redis
health checks fail with SSL/TLS handshake errors, do not fall back to .
Use on the Redis resource when the consuming app expects
plain Redis.
AddContainer()WithoutHttpsCertificate()Aspire可以自动为容器资源提供TLS证书。如果Redis健康检查因SSL/TLS握手错误失败,不要退而使用。当消费应用期望使用普通Redis连接时,在Redis资源上使用。
AddContainer()WithoutHttpsCertificate()Project-Local Override
项目本地覆盖规则
If exists (installed by or
), warn the user that a project-local
copy is present and defer to it. The plugin version is the fallback.
.agents/skills/aspireify/SKILL.mdaspire initaspire agent init --skills aspireify⚠️ Project-local .agents/skills/aspireify/SKILL.md detected — deferring to it.如果存在文件(由或安装),警告用户存在项目本地副本,并优先使用该副本。插件版本作为后备方案。
.agents/skills/aspireify/SKILL.mdaspire initaspire agent init --skills aspireify⚠️ Project-local .agents/skills/aspireify/SKILL.md detected — deferring to it.Prerequisites
前置要求
| Requirement | Install |
|---|---|
| .NET 10.0 SDK (C# AppHost) | https://dotnet.microsoft.com/download |
Node.js | https://nodejs.org |
| Aspire CLI | |
| Skeleton already dropped | |
| 要求 | 安装方式 |
|---|---|
| .NET 10.0 SDK(C# AppHost) | https://dotnet.microsoft.com/download |
Node.js | https://nodejs.org |
| Aspire CLI | |
| 已生成骨架 | |
Detection — When to Activate
触发条件 — 何时激活
Activate when ANY signal is present AND the AppHost is unwired (no resources
declared beyond the stub):
| Signal | How to Detect | Confidence |
|---|---|---|
| Skeleton just dropped | | ✅ Definitive |
| Empty AppHost stub | | ✅ Definitive |
| Config present, AppHost has no | High |
| User asks to "wire" / "scaffold resource graph" | Verb match: wire, scaffold, integrate, hook up, add Postgres/Redis/etc. | High |
| User asks "what next after aspire init" | Direct handoff request | ✅ Definitive |
| Existing repo with services + new AppHost | Repo has | High |
If the AppHost already has wired resources and the user wants to start/stop
the app → . If the user wants to deploy → .
aspire-orchestrationaspire-deployment当存在以下任意信号且AppHost尚未搭建(除存根外没有声明任何资源)时激活:
| 信号 | 检测方式 | 置信度 |
|---|---|---|
| 刚生成骨架 | 本次会话中刚运行过 | ✅ 确定 |
| 空的AppHost存根 | | ✅ 确定 |
| 配置文件存在,但AppHost中没有 | 高 |
| 用户要求“搭建”/“脚手架生成资源图” | 动词匹配:搭建、脚手架生成、集成、连接、添加Postgres/Redis等 | 高 |
| 用户询问“aspire init之后下一步做什么” | 直接的交接请求 | ✅ 确定 |
| 现有仓库包含服务 + 新的AppHost | 仓库中有 | 高 |
如果AppHost已经搭建好资源,而用户想要启动/停止应用 → 转交技能。如果用户想要部署 → 转交技能。
aspire-orchestrationaspire-deploymentLanguage Support
语言支持
| AppHost Style | Detection | Edit Target |
|---|---|---|
| C# SDK-style | | |
| File-based C# | | |
| TypeScript | Current | Configured AppHost entry point only — never edit |
See references/csharp-authoring.md and
references/typescript-authoring.md.
aspire-orchestrationapphost.ts| AppHost类型 | 检测方式 | 编辑目标 |
|---|---|---|
| C# SDK风格 | | |
| 基于文件的C# | | |
| TypeScript | 当前版本 | 仅编辑配置的AppHost入口文件 — 绝不编辑 |
参见references/csharp-authoring.md和references/typescript-authoring.md。
aspire-orchestrationapphost.tsTypeScript AppHost package managers
TypeScript AppHost包管理器
Dependency and toolchain failures belong to this skill. Before recommending a command,
inspect the AppHost directory and then its immediate eligible parent. Within each directory,
the first recognized marker wins in this order:
- in
packageManager(package.json,npm,pnpm, oryarn, optionally versioned)bun bun.lockbun.lockbpnpm-lock.yamlyarn.lock.yarnrc.ymlpackage-lock.json
An AppHost-local marker takes precedence over every parent marker. If neither directory has
a recognized marker, Aspire defaults to npm. Report the selected manager and marker.
Use the selected manager only to repair dependencies or diagnose the toolchain. The resolver
commands are , , and ; a generated brownfield pnpm
AppHost uses , while other pnpm dependency installs use
. Yarn Classic ( or a v1 lockfile) is unsupported: stop and ask the
user to upgrade to Yarn 4+ or explicitly migrate to npm, pnpm, or Bun.
npm installbun installyarn installpnpm install --ignore-workspacepnpm installyarn@1...Do not change or create, replace, or regenerate a lockfile merely to
influence detection or switch managers. Preserve existing files until the user explicitly
chooses an upgrade or migration. Start the AppHost with ,
not a raw package-manager launcher. See
references/typescript-authoring.md for the full
command matrix and resolver details.
packageManageraspire start --non-interactive依赖和工具链故障属于本技能的处理范围。在推荐命令之前,先检查AppHost目录,再检查其直接上级目录。在每个目录中,按以下顺序匹配,第一个识别到的标记生效:
- 中的
package.json字段(packageManager、npm、pnpm或yarn,可带版本号)bun bun.lockbun.lockbpnpm-lock.yamlyarn.lock.yarnrc.ymlpackage-lock.json
AppHost本地目录的标记优先级高于所有上级目录的标记。如果两个目录都没有识别到的标记,Aspire默认使用npm。需告知用户所选的包管理器和匹配的标记。
仅在修复依赖或诊断工具链问题时使用选定的包管理器。依赖解析命令为、和;生成的存量项目pnpm AppHost使用,其他pnpm依赖安装使用。不支持Yarn Classic(或v1版本的锁文件):需停止操作并要求用户升级到Yarn 4+,或明确迁移到npm、pnpm或Bun。
npm installbun installyarn installpnpm install --ignore-workspacepnpm installyarn@1...不要为了影响检测结果或切换包管理器而修改字段,也不要创建、替换或重新生成锁文件。在用户明确选择升级或迁移之前,保留现有文件。使用启动AppHost,而非直接使用包管理器的启动命令。完整的命令矩阵和解析器详情参见references/typescript-authoring.md。
packageManageraspire start --non-interactiveWorkflow Phases
工作流阶段
1. SCAN → discover projects, services, dependencies, integration candidates
2. PROPOSE → resource graph + integration list, confirm with user
3. EDIT → wire AppHost, add ServiceDefaults + OTel + health checks
4. VALIDATE → aspire start --non-interactive → aspire wait <each resource>
5. DEACTIVATE → confirm clean start, hand off to aspire-orchestrationFor the detailed, upstream-parity workflow, load these references before editing:
- apphost-wiring.md — full AppHost wiring workflow, API lookup, endpoint/parameter patterns, validation, solution updates, and cleanup.
- docker-compose.md — docker-compose migration, profiles, image mapping, ports, volumes, and .
depends_on - full-solution-apphosts.md — large solution triage, mixed SDK boundaries, solution membership, ServiceDefaults placement, and legacy host migration.
- javascript-apps.md — JavaScript resource selection, workspace/monorepo package-manager handling, ports, scripts, and TS AppHost package config.
- opentelemetry.md — optional Node.js, Python, and Go OpenTelemetry wiring for non-.NET services.
1. SCAN → discover projects, services, dependencies, integration candidates
2. PROPOSE → resource graph + integration list, confirm with user
3. EDIT → wire AppHost, add ServiceDefaults + OTel + health checks
4. VALIDATE → aspire start --non-interactive → aspire wait <each resource>
5. DEACTIVATE → confirm clean start, hand off to aspire-orchestration如需详细的、与上游一致的工作流,请在编辑前查阅以下参考资料:
- apphost-wiring.md — 完整的AppHost搭建工作流、API查询、端点/参数模式、验证、解决方案更新和清理。
- docker-compose.md — Docker Compose迁移、配置文件、镜像映射、端口、卷和。
depends_on - full-solution-apphosts.md — 大型解决方案分类、混合SDK边界、解决方案成员关系、ServiceDefaults放置和旧版宿主迁移。
- javascript-apps.md — JavaScript资源选择、工作区/ monorepo包管理器处理、端口、脚本和TS AppHost包配置。
- opentelemetry.md — 非.NET服务的可选Node.js、Python和Go OpenTelemetry配置。
1. Scan
1. 扫描
Walk the repo and inventory:
| What | How |
|---|---|
| .NET projects | |
| Node services | |
| Python services | |
| Container deps in compose | |
| Connection strings | grep |
| Integration packages | |
| Existing endpoints | hardcoded ports in |
Full heuristics in references/scan-and-propose.md.
遍历仓库并盘点以下内容:
| 内容 | 方式 |
|---|---|
| .NET项目 | |
| Node服务 | |
| Python服务 | |
| Compose中的容器依赖 | |
| 连接字符串 | 在 |
| 集成包 | 每个项目执行 |
| 现有端点 | |
完整的启发式规则参见references/scan-and-propose.md。
2. Propose
2. 提出方案
Present a resource graph before editing. Ask clarifying questions:
- "I see Postgres in — should I model it as
docker-compose.ymlor use Azure Database for PostgreSQL?"AddPostgres('db') - "Your React app hardcodes — replace with Aspire service discovery (
http://localhost:5000)?"endpoint.url - "Your API has an endpoint — exclude it from
/adminso consumers don't see it?"WithReference()
在编辑之前先展示资源图。询问澄清问题:
- “我在中发现了Postgres — 我应该将其建模为
docker-compose.yml还是使用Azure Database for PostgreSQL?”AddPostgres('db') - “你的React应用硬编码了— 是否替换为Aspire服务发现(
http://localhost:5000)?”endpoint.url - “你的API有一个端点 — 是否将其从
/admin中排除,这样消费方就看不到它了?”WithReference()
3. Edit
3. 编辑
Apply the proposed graph. Use the right authoring style for the AppHost language.
应用提出的资源图。根据AppHost的语言使用正确的编写风格。
4. Validate
4. 验证
bash
aspire start --non-interactive --format Json
aspire wait <resource> # repeat for each declared resource
aspire describe --format Json # sanity check graphFull validation flow + recovery in references/validation.md.
bash
aspire start --non-interactive --format Json
aspire wait <resource> # repeat for each declared resource
aspire describe --format Json # sanity check graph完整的验证流程和故障恢复参见references/validation.md。
5. Self-Deactivate
5. 自动停用
After a clean , announce:
aspire start✅ AppHost wired and validated. Handing off to aspire-orchestration for
day-to-day start/stop/wait. Aspireify is done.在成功运行后,告知用户:
aspire start✅ AppHost wired and validated. Handing off to aspire-orchestration for
day-to-day start/stop/wait. Aspireify is done.Integration Discovery Catalog
集成发现目录
Map detected services → Aspire integrations. See
references/scan-and-propose.md for the full
catalog.
| Detected | C# | TS |
|---|---|---|
Postgres in compose / | | |
Redis in compose / | | |
| RabbitMQ | | |
| MongoDB | | |
| Cosmos DB | | |
| Azure Service Bus | | |
| Azure Cache for Redis (Entra) | | |
| Next.js frontend | | |
| Vite SPA | | |
| Plain Node app | | |
将检测到的服务映射到Aspire集成。完整目录参见references/scan-and-propose.md。
| 检测到的内容 | C# | TS |
|---|---|---|
Compose中的Postgres / | | |
Compose中的Redis / | | |
| RabbitMQ | | |
| MongoDB | | |
| Cosmos DB | | |
| Azure Service Bus | | |
| Azure Cache for Redis(Entra) | | |
| Next.js前端 | | |
| Vite SPA | | |
| 普通Node应用 | | |
Current Authoring Rules
当前编写规则
| Rule | Why |
|---|---|
Use unified | Single API handles all value kinds; per-kind helpers are deprecated |
Use | First-class lifecycle + |
Use | Replaces hand-rolled Dockerfiles; SPA → static, SSR Node → NodeServer, package-script SSR → PackageScript |
Add | |
Bind every resource to a compute environment with | Multi-environment deploys require explicit binding |
Never edit | Generated; edits get clobbered. Edit the configured |
Use | Endpoint callbacks update existing endpoints rather than throwing on duplicates |
Mark admin endpoints with | Prevents consumers from receiving admin URLs via |
Look up unfamiliar API: | Don't guess overloads or builder chains |
Use context | |
Use | |
Check | CLI-invoked commands may be noninteractive; prefer command arguments for dashboard + CLI input |
Treat | Suppress |
Keep all Aspire SDK and | Mixed release families can fail at startup |
| Migrate GitHub Models integrations to Azure AI Foundry | |
Use | Prefer typed JSON, Search, Bloom Filter, and TimeSeries constants over raw module paths |
Use Foundry | Current Azure AI Foundry path replaces deprecated GitHub Models |
| 规则 | 原因 |
|---|---|
在TS中使用统一的 | 单一API可处理所有值类型;按类型的辅助方法已弃用 |
JS前端优先使用 | 提供一流的生命周期管理 + |
JS发布使用 | 替代手写Dockerfile;SPA → 静态站点,SSR Node → NodeServer,包脚本SSR → PackageScript |
为前端资源添加 | |
存在多个环境时,使用 | 多环境部署需要显式绑定 |
在TS AppHost中绝不编辑 | 该目录是自动生成的;编辑会被覆盖。仅编辑配置的 |
使用 | 端点回调会更新现有端点,而非因重复而抛出错误 |
使用 | 防止消费方通过 |
不熟悉的API先查询: | 不要猜测重载或构建器链 |
使用上下文的 | |
外部连接字符串使用 | |
提示用户前先检查 | CLI调用的命令可能是非交互式的;优先使用命令参数来支持仪表盘和CLI输入 |
将 | 抑制 |
所有Aspire SDK和 | 混合发布系列可能导致启动失败 |
| 将GitHub Models集成迁移到Azure AI Foundry | |
Redis 8模块使用 | 优先使用类型化的JSON、Search、Bloom Filter和TimeSeries常量,而非原始模块路径 |
托管的可执行/容器代理使用Foundry的 | 当前Azure AI Foundry路径替代了已弃用的GitHub Models |
C# vs TS Quick Reference
C#与TS快速参考
| Concept | C# | TypeScript |
|---|---|---|
| Builder | | |
| Add project | | |
| Wire env var (any value type) | | |
| Wait for dependency | | |
| Pass connection | | |
| External HTTP | | |
| Endpoint expression | | |
| Build + run | | |
| 概念 | C# | TypeScript |
|---|---|---|
| 构建器 | | |
| 添加项目 | | |
| 配置环境变量(任意值类型) | | |
| 等待依赖就绪 | | |
| 传递连接引用 | | |
| 外部HTTP端点 | | |
| 端点表达式 | | |
| 构建并运行 | | |
ServiceDefaults Wiring
ServiceDefaults配置
Each project should call to opt into OpenTelemetry,
health checks, and service discovery. Add the project
reference (or NuGet for non-monorepo). See
references/service-defaults.md.
builder.AddServiceDefaults();Aspire.ServiceDefaults每个项目都应调用以启用OpenTelemetry、健康检查和服务发现。添加项目引用(非monorepo项目使用NuGet包)。参见references/service-defaults.md。
builder.AddServiceDefaults();Aspire.ServiceDefaultsEndpoint & Reference Conventions
端点与引用约定
csharp
// Public-facing API. Mark "admin" endpoint as not-for-consumers.
var api = builder.AddProject<Projects.Api>("api")
.WithExternalHttpEndpoints()
.WithEndpoint("admin", e => e.ExcludeReferenceEndpoint = true);
// Frontend wires the API via service discovery.
builder.AddNextJsApp("web", "./web")
.WithReference(api) // injects services__api__http and __https
.WaitFor(api)
.WithBrowserLogs(); // browser console + screenshotscsharp
// Public-facing API. Mark "admin" endpoint as not-for-consumers.
var api = builder.AddProject<Projects.Api>("api")
.WithExternalHttpEndpoints()
.WithEndpoint("admin", e => e.ExcludeReferenceEndpoint = true);
// Frontend wires the API via service discovery.
builder.AddNextJsApp("web", "./web")
.WithReference(api) // injects services__api__http and __https
.WaitFor(api)
.WithBrowserLogs(); // browser console + screenshotsValidation & Recovery
验证与故障恢复
| Symptom | Action |
|---|---|
| Fix code, re-run |
| File-lock errors during edit | Hand off to |
Resource missing from | Re-run |
| TS AppHost change ignored | Confirm you edited the configured |
Mixed JSON output from | Strip non-JSON lines before parsing (#15843) |
Full flow in references/validation.md.
| 症状 | 处理方式 |
|---|---|
| 修复代码,重新运行 |
| 编辑过程中出现文件锁定错误 | 转交 |
| 重新运行 |
| TS AppHost的修改未生效 | 确认你编辑的是配置的 |
| 解析前先剥离非JSON行(#15843) |
完整流程参见references/validation.md。
Handoff Rules
交接规则
| Scenario | Route To |
|---|---|
| AppHost skeleton not yet dropped | → |
| Day-to-day start/stop/wait/restart | → |
| Publish, deploy, destroy, pipeline steps | → |
| Logs, traces, metrics, dashboard, browser log inspection | → |
| Deployed (Azure/AKS) app diagnostics | → |
| 场景 | 转交至 |
|---|---|
| AppHost骨架尚未生成 | → |
| 日常启动/停止/等待/重启 | → |
| 发布、部署、销毁、流水线步骤 | → |
| 日志、链路追踪、指标、仪表盘、浏览器日志检查 | → |
| 已部署(Azure/AKS)应用的诊断 | → |
Key Rules
核心规则
- Never overwrite existing files — always augment or merge.
- Ask before modifying service code, especially OpenTelemetry and ServiceDefaults injection.
- Respect existing project structure — do not reorganize the repo.
- If stuck, use to diagnose environment issues.
aspire doctor - Never hardcode URLs in /
WithEnvironment— pass endpoint references such aswithEnvironmentorapi.GetEndpoint("http")instead of string literals.api.getEndpoint('http') - Never use /
WithUrlForEndpointto setwithUrlForEndpointURLs — that API is only for dashboard display labels;dev.localhostbelongs in AppHost launch/profile configuration.dev.localhost
- 绝不覆盖现有文件 — 始终采用增量或合并的方式。
- 修改服务代码前先询问,尤其是OpenTelemetry和ServiceDefaults注入。
- 尊重现有项目结构 — 不要重构仓库。
- **如果遇到问题,使用**诊断环境问题。
aspire doctor - 不要在/
WithEnvironment中硬编码URL — 传递端点引用,例如withEnvironment或api.GetEndpoint("http"),而非字符串字面量。api.getEndpoint('http') - 不要使用/
WithUrlForEndpoint设置withUrlForEndpointURL — 该API仅用于仪表盘显示标签;dev.localhost应在AppHost启动/配置文件中设置。dev.localhost
References
参考资料
- apphost-wiring.md — Detailed AppHost wiring workflow and API lookup patterns
- docker-compose.md — Docker Compose migration patterns
- full-solution-apphosts.md — Large/full-solution AppHost guidance
- javascript-apps.md — JavaScript/TypeScript app and workspace handling
- opentelemetry.md — Non-.NET OpenTelemetry setup
- scan-and-propose.md — Repo scan heuristics + integration catalog
- csharp-authoring.md — C# AppHost patterns
- typescript-authoring.md — TS AppHost patterns + parity APIs
- service-defaults.md — Wire OTel, health checks, service discovery
- validation.md — End-to-end validation + recovery
- aspire-13-5-breaking-changes.md — Breaking changes introduced in 13.5 and fixes for affected releases
- apphost-wiring.md — 详细的AppHost搭建工作流和API查询模式
- docker-compose.md — Docker Compose迁移模式
- full-solution-apphosts.md — 大型/完整解决方案AppHost指南
- javascript-apps.md — JavaScript/TypeScript应用和工作区处理
- opentelemetry.md — 非.NET OpenTelemetry设置
- scan-and-propose.md — 仓库扫描启发式规则 + 集成目录
- csharp-authoring.md — C# AppHost模式
- typescript-authoring.md — TS AppHost模式 + 等效API
- service-defaults.md — 配置OTel、健康检查、服务发现
- validation.md — 端到端验证 + 故障恢复
- aspire-13-5-breaking-changes.md — 13.5版本引入的破坏性变更及受影响版本的修复方法