Skip to content

Add test project upgrade guidance to upgrade-aspire page#512

Open
Copilot wants to merge 2 commits intomainfrom
copilot/fix-upgrade-test-project-section
Open

Add test project upgrade guidance to upgrade-aspire page#512
Copilot wants to merge 2 commits intomainfrom
copilot/fix-upgrade-test-project-section

Conversation

Copy link
Contributor

Copilot AI commented Mar 5, 2026

The upgrade guide at /whats-new/upgrade-aspire/ had no mention of test projects. Users upgrading to Aspire 13.0+ hit a common break: the Projects namespace disappears from test projects after the AppHost migrates to Aspire.AppHost.Sdk.

Changes

  • New "Upgrade test projects" section with steps to update Aspire.Hosting.Testing, verify the ProjectReference to AppHost, and run tests
  • Caution callout for the Projects namespace resolution failure — the most common upgrade issue — with a checklist of things to verify
  • Expanded "Verify the upgrade" to include dotnet test alongside aspire run

Upgrade test projects section


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Addresses dotnet/docs-aspire#5663 by adding guidance on upgrading
Aspire test projects, including updating the Aspire.Hosting.Testing
package, verifying project references, and troubleshooting the
common 'Projects namespace not found' compilation error.

Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix upgrade section for test projects in aspire migration Add test project upgrade guidance to upgrade-aspire page Mar 5, 2026
Copy link
Member

@IEvangelist IEvangelist left a comment

Choose a reason for hiding this comment

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

This PR looks good so far, but let's double check it for accuracy by using the .github/skills/doc-tester/SKILL.md skill. Please also consider all new comments and feedback/suggestions. @copilot

@IEvangelist IEvangelist marked this pull request as ready for review March 12, 2026 18:22
Copilot AI review requested due to automatic review settings March 12, 2026 18:22
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

Adds upgrade guidance for Aspire test projects to the “Upgrade Aspire” documentation, helping users keep Aspire.Hosting.Testing and AppHost references aligned during upgrades.

Changes:

  • Add a new “Upgrade test projects” section with steps for updating Aspire.Hosting.Testing, validating AppHost ProjectReference, and running tests.
  • Add an additional reminder in “Verify the upgrade” to run dotnet test when test projects exist.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +84 to +88
dotnet add <your-test-project>.csproj package Aspire.Hosting.Testing
```

<Aside type="tip">
If you're using Central Package Management (CPM), update the version in your _Directory.Packages.props_ file instead.
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

Step 1 says to update Aspire.Hosting.Testing to match the AppHost version, but the command shown doesn't specify a version and will resolve whatever NuGet considers "latest" (which may not match the AppHost/SDK version, especially if users are upgrading to a specific version or using previews). Consider showing the command with an explicit --version (matching Aspire.AppHost.Sdk / the package versions in the solution), or otherwise clarifying that it will update to the latest available.

Suggested change
dotnet add <your-test-project>.csproj package Aspire.Hosting.Testing
```
<Aside type="tip">
If you're using Central Package Management (CPM), update the version in your _Directory.Packages.props_ file instead.
dotnet add <your-test-project>.csproj package Aspire.Hosting.Testing --version <AppHostVersion>
```
<Aside type="tip">
Use the same version here as your `Aspire.AppHost.Sdk` (for example, `9.1.0`). If you're using Central Package Management (CPM), update the version in your _Directory.Packages.props_ file instead.

Copilot uses AI. Check for mistakes.
<Aside type="caution" title="Projects namespace not found?">
If your tests fail to compile with an error that the `Projects` namespace doesn't exist, ensure:

- Your AppHost project uses the [`Aspire.AppHost.Sdk`](/get-started/aspire-sdk/) (for example, `<Project Sdk="Aspire.AppHost.Sdk/13.1">`).
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

This page is an evergreen "Upgrade Aspire" guide, but the troubleshooting Aside hard-codes a specific SDK version (Aspire.AppHost.Sdk/13.1) in the example. That will become incorrect as soon as the latest version changes. Prefer a version placeholder (for example Aspire.AppHost.Sdk/<version>) or wording that points readers to the version currently used in their AppHost project.

Suggested change
- Your AppHost project uses the [`Aspire.AppHost.Sdk`](/get-started/aspire-sdk/) (for example, `<Project Sdk="Aspire.AppHost.Sdk/13.1">`).
- Your AppHost project uses the [`Aspire.AppHost.Sdk`](/get-started/aspire-sdk/) (for example, `<Project Sdk="Aspire.AppHost.Sdk/&lt;version&gt;">`, where `<version>` matches the SDK version used by your AppHost).

Copilot uses AI. Check for mistakes.
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.

3 participants