You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[release/17.0] Report obsolete Aspire.AppHost.Sdk in aspire update --migrate - #22340
aspire update --migrate printed "Nothing to migrate. The current project is already using the latest recommended Aspire conventions." for C# AppHosts that still use Aspire.AppHost.Sdk, even though the next build emits ASPIRE012. Removing the SDK is intentionally approval-gated and is not applied automatically, so this PR only changes the message.
When no automatic migrations apply and the AppHost still declares Aspire.AppHost.Sdk, the CLI now prints:
No automatic migrations apply. This AppHost still uses Aspire.AppHost.Sdk (ASPIRE012), which is obsolete. See https://aka.ms/aspire/diagnostics/aspire012 for how to migrate.
Detection (DotNetAppHostProject.UsesObsoleteAppHostSdk) checks the AppHost file after the package update ran:
file-based apphost.cs: #:sdk Aspire.AppHost.Sdk[@version] in the directive preamble (reuses FallbackProjectParser)
respects suppression declared in the AppHost file itself (SuppressAspireAppHostSdkObsoleteWarning=true or NoWarn containing ASPIRE012, mirroring the check in Sdk.in.targets)
Plain aspire update (without --migrate) prints nothing when no migrations are pending, so it is unaffected.
The aka.ms link is the same HelpLink used by the ASPIRE012 warning; the docs page is being added in microsoft/aspire.dev#2180. Related: #22336.
When no automatic migrations apply but the AppHost still uses Aspire.AppHost.Sdk
(ASPIRE012), don't claim the project already follows the latest conventions.
Point users at the ASPIRE012 migration guidance instead.
Fixes#22335
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Suppression detection misses ASPIRE012 in non-final NoWarn entries and incorrectly treats inactive conditional properties as active, causing migration guidance to disagree with build warnings.
Updates aspire update --migrate to report obsolete Aspire.AppHost.Sdk usage instead of claiming the AppHost follows the latest conventions. SDK removal remains approval-gated and is not automated.
Changes:
Detects legacy SDK declarations and local warning suppressions in C# AppHost files.
Adds an ASPIRE012 advisory with migration guidance when no automatic migrations apply.
Adds detection and command-output tests, plus localization resource entries.
root.Descendants() counts suppression assignments inside targets that have not executed. An unconditional SuppressAspireAppHostSdkObsoleteWarning=true inside a target with AfterTargets="Build" therefore restores the misleading “latest recommended conventions” message, even though ASPIRE012 runs before PrepareForBuild. Restrict suppression detection to evaluation-time project property groups and add a regression test for a late target assignment.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Suppression detection ignores later property overrides, allowing --migrate to report current conventions while the build still emits ASPIRE012; assignment ordering and regression coverage need correction.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Honor later assignments when determining warning suppression
Any() treats an earlier suppression as active even when a later unconditional assignment clears it, so --migrate can still report “latest recommended conventions” while the build emits ASPIRE012. For example, assigning NoWarn first to ASPIRE012 and then to NU1605, or setting SuppressAspireAppHostSdkObsoleteWarning to true and then false, triggers this mismatch. Honor assignment order while preserving $(NoWarn) append semantics, and add regression cases for both overwritten properties.
excluded → base_branch_is_release, title_release_prefix. The PR is a backport ([release/17.0] title prefix, release base). Docs belong with the original forward PR. Triggered signals (advisory): cli_command_file_changed (UpdateCommand.cs), cli_resource_strings_changed (MigrationStrings.resx), pr_body_has_cli_flag_mention, pr_body_has_deprecation_marker.
…pire.AppHost.Sdk (#2180)
## Summary
<!-- Describe what this pull request changes and why. -->
Moves aspire.dev off the legacy
`AddProject`/`AddCSharpApp`/`ProjectResource` APIs onto Aspire 17's
`AddDotnetProject`/`DotnetProjectResource`, and removes the obsolete
`Aspire.AppHost.Sdk`. Tracked in #2179.
**New pages**
- [Migrate to the new
DotnetProjectResource](/integrations/dotnet/migrate-dotnet-project-resource/):
why to upgrade, the agent-skill option, path/launch-profile/type
changes, and removing the AppHost SDK.
- `ASPIRE012` diagnostic (`Aspire.AppHost.Sdk` is obsolete), with
sidebar and overview rows. The `aspire update --migrate` notice from
microsoft/aspire#22340 links to it.
**Evergreen rewrites**
- `dotnet-host` is now the main .NET page. It adds endpoint filtering,
coordinated builds/restore, multithreaded builds, and links to
file-based apps and launch profiles.
- `get-started/aspire-sdk` is now "C# AppHost project configuration".
- C# file-based apps and launch profiles now use `AddDotnetProject`.
- `project-resources` becomes a short "Legacy project resources"
reference, listed in the sidebar below the migration guide. Inbound
links now point to `dotnet-host`.
**Sample sweep (C#/TS/Go)**
- Converted `AddProject<Projects.X>`, `addProject`, and `AddCSharpApp`
across app-host, fundamentals, deployment, get-started, testing,
architecture, and integration pages. This includes Blazor hosting,
WPF/WinForms, and container files.
- Testing samples now use
`CreateResourceBuilder<DotnetProjectResource>`, matching the 17 starter
template.
- Short `:::note[Upgrading to Aspire 17?]` pointers are added only where
readers are likely on the old API.
**Japanese docs**
- Only code fences are converted. Prose is left for the translation
pipeline.
**Out of scope / tracked upstream**
- Historical release notes (except link anchors), Azure Functions
(`AddAzureFunctionsProject`, microsoft/aspire#21345), Blazor gateway
upstream (microsoft/aspire#20837), and MAUI (microsoft/aspire#21350).
Supersedes the ASPIRE012/AppHost SDK parts of #1880 (not its ASPIRE010
changes).
Relates to #2179, microsoft/aspire#22336, microsoft/aspire#22335, and
microsoft/aspire#22340.
**Merge note:** #2085 (ASPIRE014) and #2110 (ASPIRE015) add rows next to
ASPIRE012 in `reference.topics.ts` and `diagnostics/overview.mdx`. If
either merges first, keep both rows in numeric order (011–015).
## Third-party links and affiliations
<!--
List any third-party links added or changed by this pull request and
disclose any
material affiliation with the linked organizations, such as employment,
sponsorship, or ownership. Write "None" if this pull request doesn't add
or
change third-party links.
-->
None
## Validation
<!-- List the checks you ran or explain why validation isn't needed. -->
- `bun run test:unit:twoslash-blocks`: the only failures are the 2
pre-existing `asOptional` ones in
`fundamentals/external-parameters.mdx`. No new failures.
- `bun x vitest run tests/unit/seo-lengths.vitest.test.ts`: passed.
- Local `astro dev`: changed EN and ja pages return 200, and new anchors
resolve.
- Runtime-checked with the .NET 11 SDK: `AddDotnetProject` with
WPF/WinForms, C# Blazor (`AddDotnetProjectBlazorGateway`), and TS Blazor
AppHosts.
- `bun run build` was not run locally; left to CI.
---------
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Karol Zadora-Przylecki <karolz@microsoft.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: karolz-ms <15271049+karolz-ms@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
aspire update --migrateprinted "Nothing to migrate. The current project is already using the latest recommended Aspire conventions." for C# AppHosts that still useAspire.AppHost.Sdk, even though the next build emits ASPIRE012. Removing the SDK is intentionally approval-gated and is not applied automatically, so this PR only changes the message.When no automatic migrations apply and the AppHost still declares
Aspire.AppHost.Sdk, the CLI now prints:Detection (
DotNetAppHostProject.UsesObsoleteAppHostSdk) checks the AppHost file after the package update ran:apphost.cs:#:sdk Aspire.AppHost.Sdk[@version]in the directive preamble (reusesFallbackProjectParser)Sdk="Aspire.AppHost.Sdk[/version]"(incl. multi-SDK lists),<Sdk Name="Aspire.AppHost.Sdk" />,<Import Sdk="Aspire.AppHost.Sdk" />SuppressAspireAppHostSdkObsoleteWarning=trueorNoWarncontainingASPIRE012, mirroring the check inSdk.in.targets)Plain
aspire update(without--migrate) prints nothing when no migrations are pending, so it is unaffected.The aka.ms link is the same
HelpLinkused by the ASPIRE012 warning; the docs page is being added in microsoft/aspire.dev#2180. Related: #22336.Fixes #22335
Checklist