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:
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 <[email protected]>
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 <[email protected]>
Co-authored-by: Karol Zadora-Przylecki <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: karolz-ms <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
#22348)
<!-- copilot-assessment:v1 -->
### Agent assessment
Self-reported assessment, not an independent review.
Assessed revision: `8848ddee8533bee493addca4155693c0a4d35ee8`
| Dimension | Assessment | Rationale |
|---|---|---|
| Change confidence | 8.5/10 | ↑ Native macOS archive and routing tests
passed 193/193; binary-xattr probe preserved log contents and restored
the environment.<br>↓ New-head hosted Linux/Windows execution and the
intermittent upload race remain unverified; [CI is
running](https://github.com/microsoft/aspire/actions/runs/45334663754).
|
| Diagnosis confidence | 9/10 | ↑ Reported uploader failure names the
changing dependency directory excluded by tar; native macOS baseline
reproduced synthesized hidden metadata entries.<br>↓ The original
installer/upload race was not reproduced end-to-end. |
| Evidence fit | 8/10 | ↑ The retained failure evidence matches the
starter job, upload step, and frontend/node_modules path addressed by
this archive boundary.<br>↓ The macOS metadata correction addresses
archive correctness, not proof of the original race's timing. |
<!-- /copilot-assessment -->
## Description
The macOS CLI starter validation job intermittently fails in "Upload
starter validation diagnostics":
```text
ENOENT: no such file or directory, stat '.../aspire-go-starter/AspireCliGoStarterSmoke/frontend/node_modules'
```
The starter's npm installer can still change `node_modules` after
`aspire stop` returns. The pinned uploader enumerates paths and then
stats each result; a disappearing entry fails the upload. Negative
upload globs remove results but still traverse excluded directories.
Archive the diagnostics with `tar --exclude=node_modules` before
uploading, rather than maintaining a recursive copier. Only the
completed `starter-validation.tar` is uploaded; failed creation removes
the partial archive and fails the step. All nonzero tar exits remain
errors, including files changing or disappearing outside excluded
directories. This is not an atomic filesystem snapshot.
The archive retains generated project sources/manifests and diagnostics
under the validation-root directory. It preserves the uploader's default
exclusion of hidden files/directories and records symbolic links without
following their targets. macOS filesystem metadata is omitted using the
existing `CreateLayout` approach, so synthesized AppleDouble entries
cannot bypass hidden-file exclusions. The uploader compresses the
uncompressed tar.
The tests invoke the existing `PowerShellCommand` harness directly,
retaining its timeout, output capture, and process cleanup. The
test-trigger map selects both starter validation and
`Infrastructure.Tests` for script-only changes.
`scratch-cli-platform-smoke.yml` uses the same reusable workflow.
Evidence:
https://github.com/microsoft/aspire/actions/runs/43968755832/job/133671867903
(PR #22340, macOS x64).
Validation:
- macOS 27.2.1 arm64, .NET SDK 11.0.100, PowerShell 7.6.6, BSD tar 3.5.3
/ libarchive 3.7.4:
`MSBUILDTERMINALLOGGER=false dotnet test --project
tests/Infrastructure.Tests/Infrastructure.Tests.csproj
--no-launch-profile -- --filter-class
'*.StageCliStarterValidationDiagnosticsTests' --filter-class
'*.TestTriggerMapTests' --filter-not-trait 'quarantined=true'
--filter-not-trait 'outerloop=true'`: **passed 193/193**, no skipped
tests, against the final source committed as the assessed revision.
- The native macOS baseline at
`014fc591cafcd2f5fca46cdb80451db718482759` failed two of the five
archive scenarios on unexpected `._validation` entries. The unchanged
assertions now pass; Linux-only infrastructure CI would not exercise
Apple's synthesized metadata.
- Tests cover retained file contents, nested dependencies, hidden
files/directories, paths containing spaces, dangling/directory links,
missing source and stale output, and tar exit codes 1/2 with partial
output.
- A native tar probe with an injected binary macOS xattr retained the
log, omitted the xattr and synthesized metadata files, and confirmed
that the script restores the caller's `COPYFILE_DISABLE`.
- `./restore.sh`: **passed**, zero warnings/errors. No package/feed
configuration or audit override was changed.
Current-head hosted execution and the intermittent production race
remain **unvalidated**. The [prior-head CI
run](https://github.com/microsoft/aspire/actions/runs/44020721715)
succeeded at attempt 2 with all six starter platform jobs successful; it
does not validate the assessed revision or establish first-attempt
reliability. Local Linux validation could not run because the Docker
daemon socket is absent.
Refs #22347. The `release/17.0` backport is pending human merge of this
main fix.
## Checklist
- Is this feature complete?
- [x] Yes. Ready to ship.
- [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
- [x] Yes
- [ ] No
- Did you add public API?
- [ ] Yes
- If yes, did you have an API Review for it?
- [ ] Yes
- [ ] No
- Did you add `<remarks />` and `<code />` elements on your triple slash
comments?
- [ ] Yes
- [ ] No
- [x] No
- Does the change make any security assumptions or guarantees?
- [ ] Yes
- If yes, have you done a threat model and had a security review?
- [ ] Yes
- [ ] No
- [x] No
<!-- cif issue:22347 -->
---------
Co-authored-by: radical <[email protected]>
Co-authored-by: Copilot <[email protected]>
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