Skip to content

docs: add "Add project references" step to C# add-Aspire-to-existing-app guide#471

Merged
IEvangelist merged 2 commits intomainfrom
copilot/add-project-references-step
Feb 25, 2026
Merged

docs: add "Add project references" step to C# add-Aspire-to-existing-app guide#471
IEvangelist merged 2 commits intomainfrom
copilot/add-project-references-step

Conversation

Copy link
Contributor

Copilot AI commented Feb 24, 2026

The C# path of the "Aspireify an existing app" guide was missing a critical step: the AppHost project must have <ProjectReference> entries for every C# project it orchestrates, because those references are what generate the Projects.Foo marker types required by AddProject<T>. Without this, users hit confusing build errors after manually expanding beyond what aspire init scaffolded.

Changes

  • New ### Add project references section (C# pivot only) inserted between "Install hosting packages" and "Model your resources in the AppHost" in both the English and Japanese docs
    • Explains why references are required (marker type generation)
    • Notes that aspire init handles this automatically for initially selected projects
    • Shows dotnet add reference commands for adding projects later:
      dotnet add reference ../Api/ExampleCommerce.Api.csproj
      dotnet add reference ../Web/ExampleCommerce.Web.csproj
      dotnet add reference ../OrderProcessor/ExampleCommerce.OrderProcessor.csproj
    • Shows the resulting .csproj XML for users who prefer editing the project file directly
Original prompt

This section details on the original issue you should resolve

<issue_title>get-started/add-aspire-existing-app for C# missing step to add project references</issue_title>
<issue_description>https://aspire.dev/get-started/add-aspire-existing-app/?lang=csharp#model-your-resources-in-the-apphost

This is missing the crucial detail that any projects you want the AppHost to orchestrate need to be referenced by the AppHost project, e.g. the API and Web app projects. aspire init will discover projects and prompt which ones to add to the generated AppHost project, but if you need to add more later manually, not knowing this detail will likely lead to folks getting stuck. Without the project references, the marker types required to pass to AddProject<T> aren't generated.

After the "Install hosting packages" and before the "Model your resources in the AppHost" step, there should be a step detailing that C# project resources need to be added as <Project Reference /> items in the AppHost project file, e.g.:

$ ExampleCommerce.AppHost> dotnet add project reference ../Api/ExampleCommerce.Api.csproj
$ ExampleCommerce.AppHost> dotnet add project reference ../Web/ExampleCommerce.Web.csproj
$ ExampleCommerce.AppHost> dotnet add project reference ../OrderProcessor/ExampleCommerce.OrderProcessor.csproj

aspire init willl do this automatically for projects selected when it asks, but it's important the detail is expressly called out.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…uide

Co-authored-by: DamianEdwards <249088+DamianEdwards@users.noreply.github.com>
Copilot AI changed the title [WIP] Add missing step for project references in C# setup docs: add "Add project references" step to C# add-Aspire-to-existing-app guide Feb 24, 2026
@DamianEdwards DamianEdwards marked this pull request as ready for review February 24, 2026 21:54
Copilot AI review requested due to automatic review settings February 24, 2026 21:54
Copy link
Member

@DamianEdwards DamianEdwards left a comment

Choose a reason for hiding this comment

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

Looks good to me

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a critical missing step to the "Add Aspire to existing app" getting started guide. The C# path was previously missing documentation about the requirement for AppHost projects to have project references to orchestrated C# projects. These references are essential because they trigger the code generation that produces the Projects.* marker types required by AddProject<T>. Without this step documented, users who manually add projects beyond what aspire init scaffolds would encounter confusing build errors.

Changes:

  • Added new "Add project references" section to the C# path (both English and Japanese versions)
  • Section placed strategically between "Install hosting packages" and "Model your resources"
  • Includes explanation of why references are needed (marker type generation), notes that aspire init handles this automatically, and provides both CLI commands and XML examples for manually adding references

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/frontend/src/content/docs/get-started/add-aspire-existing-app.mdx Adds "Add project references" section with CLI commands and XML examples for C# projects in English
src/frontend/src/content/docs/ja/get-started/add-aspire-existing-app.mdx Adds "Add project references" section with CLI commands and XML examples for C# projects in Japanese

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


<Pivot id="csharp">

AppHost で `AddProject<T>` を使用するには、AppHost プロジェクトがオーケストレーション対象の各 C# プロジェクトへのプロジェクト参照を持っている必要があります。これらのプロジェクト参照が、`AddProject<T>` で使用される `Projects.YourProject` マーカー型を生成します。
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there is a subtle grammatical error here

@IEvangelist IEvangelist merged commit c10c754 into main Feb 25, 2026
10 checks passed
@IEvangelist IEvangelist deleted the copilot/add-project-references-step branch February 25, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get-started/add-aspire-existing-app for C# missing step to add project references

5 participants