Skip to content

[docs] Document aspire init --file-based option - #1648

Merged
David Pine (IEvangelist) merged 1 commit into
release/13.6from
docs/pr-20004-34572553049-1-56afa4ff6f9cda38
Sep 23, 2026
Merged

David Pine (IEvangelist) merged 1 commit into
release/13.6from
docs/pr-20004-34572553049-1-56afa4ff6f9cda38

Conversation

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Documents changes from microsoft/aspire#20004

@mitchdenny

Targeting release/13.6 based on the source PR milestone 13.6.

Why

microsoft/aspire#20004 adds a new --file-based option to aspire init. Repositories can contain incidental .sln/.slnx files that make aspire init prompt for a solution or scaffold a project-based AppHost even when the user only wants an empty, file-based AppHost at the repository root. --file-based bypasses .NET solution discovery entirely and always creates the single-file apphost.cs scaffold. The option requires C# — selecting another language explicitly, via configuration, or at the language prompt fails with a clear error before scaffolding or persisting the language selection.

This is a new CLI option with no prior documentation, so the aspire init reference page needed to be updated.

What changed

Updated src/frontend/src/content/docs/reference/cli/commands/aspire-init.mdx:

  • Added a new "Skipping solution discovery with --file-based" subsection under Description, explaining the problem it solves, its behavior, and the C#-only requirement.
  • Added --file-based to the Options list with a description matching the CLI's own --help text.
  • Added a usage example under Examples showing aspire init --file-based --language csharp.

No new pages were created; only the existing aspire-init.mdx page was updated.

Generated by PR Documentation Check for #20004 · auto · 62.5 AIC · ⌖ 11 AIC · ⊞ 18.3K · ◷

Documents the --file-based flag added in microsoft/aspire#20004, which
bypasses .NET solution discovery to always scaffold a single-file
apphost.cs and requires C#.

Co-authored-by: Copilot <[email protected]>
@aspire-repo-bot aspire-repo-bot Bot added the docs-from-code Copilot initiated issue from dotnet/aspire repo label Sep 11, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor Author

Frontend HTML artifact ready

The latest frontend build uploaded the frontend-dist artifact for PR #1648. Use the VS Code button below to open this PR with GitHub Artifacts Explorer and browse the built HTML locally.

VS Code: Open PR #1648 artifacts

This comment updates automatically when a new frontend build artifact is uploaded.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The documentation contains a claim that conflicts with existing AppHost protection and needs clarification.

Review effort: Lite
Findings: None

What changed in this PR

Documents the new C#-only aspire init --file-based option.

Changes:

  • Explains solution-discovery bypass and behavior.
  • Adds the option reference.
  • Adds a usage example.
File Summary
src/​frontend/​src/​content/​docs/​reference/​cli/​commands/​aspire-init.mdx Documents --file-based behavior, constraints, and usage.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@IEvangelist David Pine (IEvangelist) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated docs-accuracy review

Phase A source of truth: microsoft/aspire @ release/13.6 (SHA 63b5556c7f4de9b259d6ba71a312f597a72bf307), source PR microsoft/aspire#20004 (commit cc51526083).
Claims extracted: 6 non-narrative → 6 verified, 0 verified-with-nuance, 0 unverifiable, 0 contradicted.
Phase B (doc-tester): exercised /reference/cli/commands/aspire-init/ — 0 critical, 0 warnings.

Verdict: APPROVE — every verifiable claim matches source; the option description mirrors the CLI help verbatim.


Phase A — Claim verification

✅ Verified claims (6) — evidence
  • C1 — --file-based option exists on aspire init (aspire-init.mdx:117): verified. InitCommand.cs — _fileBasedOption = new Option<bool>("--file-based"), then Options.Add(_fileBasedOption).
  • C2 — Bypasses .NET solution discovery and creates the single-file apphost.cs scaffold regardless of any .sln/.slnx (aspire-init.mdx:49): verified. InitCommand.cs gates discovery with if (isCSharp && !fileBased) { solutionFile = await _solutionLocator.FindSolutionFileAsync(...) }; the added comment reads "File-based initialization bypasses discovery so incidental solutions cannot trigger a prompt." A null solution takes the existing single-file path.
  • C3 — Requires C#; fails with an error before scaffolding or persisting the language when another language is selected (explicitly, via config, or at the prompt) (aspire-init.mdx:51): verified. isCSharp is derived from selectedProject.LanguageId (which resolves --language, aspire.config.json, and the interactive prompt), then if (fileBased && !isCSharp) return CommandResult.Failure(CliExitCodes.InvalidCommand, InitCommandStrings.FileBasedRequiresCSharp) — returning before discovery/scaffold/persist. The commit message states it rejects non-C# "before scaffolding or persisting language preferences."
  • C4 — Omitting --file-based (or --file-based false) preserves normal initialization for all languages (aspire-init.mdx:51): verified. It's an Option<bool> (defaults to false); a false value takes the normal isCSharp && !fileBased discovery path.
  • C5 — Existing-file protection and agent skill setup are unaffected (aspire-init.mdx:51): verified. The change touches only the solution-discovery guard and the C# check; the overwrite safeguards and skill-setup paths are untouched. The option was deliberately renamed from --force-empty to --file-based specifically to clarify it does not bypass overwrite protection.
  • C6 — Options-list description text (aspire-init.mdx:119): verified. InitCommandStrings.resx — FileBasedOptionDescription = "Create apphost.cs in the current directory, skipping .NET solution discovery. Requires C#." — an exact match for the doc's option bullet; FileBasedRequiresCSharp corroborates the "fails with an error" wording.

Phase B — Doc-tester results

Scope: doc routes affected by this PR's diff. Tested against the live production site (release/13.6 is not yet published, no per-PR preview exists, and frontend deps are not installed in this hourly job).

Critical issues: none.
Warnings: none.

Passed checks:

  • /reference/cli/commands/aspire-init/ loads (200); all three insertion points are present and land cleanly: the new ### Skipping solution discovery with --file-based section goes before ### Channel persistence in aspire.config.json; the new --file-based option bullet follows --language in Options; the new example joins the Examples list.

Knowledge gaps / limitations:

  • PR content isn't deployed, so the new section, option bullet, and example couldn't be rendered as they will appear.
  • The --file-based CLI runtime behavior can't be exercised from the docs site. Phase A confirmed it from source (InitCommand.cs + the localized help strings).

Automated review. Phase A reads microsoft/aspire source; Phase B validates the rendered docs site as a blind user; only PR-changed content and its routes were in scope.

@IEvangelist
David Pine (IEvangelist) merged commit dd8b148 into release/13.6 Sep 23, 2026
11 of 12 checks passed
@IEvangelist
David Pine (IEvangelist) deleted the docs/pr-20004-34572553049-1-56afa4ff6f9cda38 branch September 23, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-from-code Copilot initiated issue from dotnet/aspire repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants