Skip to content

Migrate C# AppHosts off the obsolete Aspire SDK - #2541

Merged
aaronpowell merged 7 commits into
CommunityToolkit:mainfrom
aaronpowell:aaronpowell-migrate-apphosts-to-aspire-17
Nov 18, 2026
Merged

aaronpowell merged 7 commits into
CommunityToolkit:mainfrom
aaronpowell:aaronpowell-migrate-apphosts-to-aspire-17

Conversation

@aaronpowell

Copy link
Copy Markdown
Member

Follows up on #2338; no separate tracking issue identified.

Move all 68 project-based C# AppHosts (67 examples and the Ollama test AppHost) to Microsoft.NET.Sdk with explicit centrally pinned Aspire.Hosting.AppHost and Aspire.Hosting.Dotnet references at the existing 17.0.0-preview.1.26555.11 pin. Move the shared test library off the obsolete SDK as well. This removes ASPIRE012 at its source without suppression. No file-based C# AppHosts were found.

The 45 live .NET project registrations in the AppHosts already use AddDotnetProject; update the stale Solr snippet and preserve the unrelated Foundry AddProject call and the legacy ProjectResource regression test. Make 47 previously implicit project-resource metadata edges explicit, including the references needed for generated Projects.* metadata and the custom SQL database project API. No project references were removed. Update setup and nightly-upgrade guidance to use the central package pins.

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • New integration (not applicable)
    • Docs are written (not applicable)
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that) (not applicable)
  • Tests for the changes have been added (for bug fixes / features) (if applicable; existing coverage used)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs (no new APIs)
  • Code follows all style conventions

Other information

See the Aspire 17 migration guide.

  • dotnet build CommunityToolkit.Aspire.slnx --nologo -v:q -warnaserror:ASPIRE012 -m:4 — passed; no ASPIRE012. The SQL database project still emits ASPIRE004 because its metadata points to a non-executable project.
  • dotnet build <AppHost.csproj> --nologo -v:q -warnaserror:ASPIRE012 — passed for each AppHost not listed in the solution: Chroma, Keycloak Extensions, Python Extensions, Umami and Zitadel. ActiveMQ also passed with zero warnings after reproducing ASPIRE012 on main.
  • dotnet test --project tests/CommunityToolkit.Aspire.Hosting.DbGate.Tests/CommunityToolkit.Aspire.Hosting.DbGate.Tests.csproj -- --filter-class '*AppHostModelTests' — passed (1 test).
  • gh aw compile aspire-upgrade --no-emit --no-check-update — passed; the generated workflow imports the Markdown prompt at runtime.
  • git diff --check and an XML audit across all 69 converted project files — passed.

aaronpowell and others added 3 commits November 18, 2026 10:48
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.sh | bash -s -- 2541

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.ps1) } 2541"

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.

🟢 Approval recommended

No active review issues require resolution for the AppHost SDK migration.

No open issues 🎉

What changed in this PR

Completes the AppHost SDK migration deferred by #2338, moving the Toolkit’s C# examples and test infrastructure off the obsolete SDK while retaining the existing Aspire nightly version.

Changes:

  • Migrates 68 AppHosts to Microsoft.NET.Sdk with explicit hosting packages, and migrates the shared test library.
  • Makes 47 project-resource references explicit to preserve generated metadata and build dependencies.
  • Centrally pins Aspire.Hosting.AppHost, removes the obsolete SDK pin, and updates setup, upgrade guidance, and the commented Solr example.
File Description
tests/​CommunityToolkit.Aspire.Testing/​CommunityToolkit.Aspire.Testing.csproj Migrates the shared library SDK; adds the hosting namespace import.
tests-app-hosts/​Ollama.AppHost/​Ollama.AppHost.csproj Migrates the test AppHost SDK and package references.
global.json Removes the obsolete AppHost SDK pin.
examples/​zitadel/​CommunityToolkit.Aspire.Hosting.Zitadel.AppHost/​CommunityToolkit.Aspire.Hosting.Zitadel.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​umami/​CommunityToolkit.Aspire.Hosting.Umami.AppHost/​CommunityToolkit.Aspire.Hosting.Umami.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​tempo/​CommunityToolkit.Aspire.Hosting.Tempo.AppHost/​CommunityToolkit.Aspire.Hosting.Tempo.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​surrealdb/​CommunityToolkit.Aspire.Hosting.SurrealDb.AppHost/​CommunityToolkit.Aspire.Hosting.SurrealDb.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​stripe/​CommunityToolkit.Aspire.Hosting.Stripe.AppHost/​CommunityToolkit.Aspire.Hosting.Stripe.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​stable-diffusion-cpp/​CommunityToolkit.Aspire.Hosting.StableDiffusionCpp.AppHost/​CommunityToolkit.Aspire.Hosting.StableDiffusionCpp.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​squad/​CommunityToolkit.Aspire.Hosting.Squad.AppHost/​CommunityToolkit.Aspire.Hosting.Squad.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​sqlserver-ext/​CommunityToolkit.Aspire.Hosting.SqlServer.Extensions.AppHost/​CommunityToolkit.Aspire.Hosting.SqlServer.Extensions.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​sqlite/​CommunityToolkit.Aspire.Sqlite.AppHost/​CommunityToolkit.Aspire.Sqlite.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​sql-database-projects/​CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects.AppHost/​CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects.AppHost.csproj Migrates SDK/packages; retains explicit SQL project metadata and build reference.
examples/​solr/​CommunityToolkit.Aspire.Hosting.Solr.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​solr/​AppHost.cs Updates the commented example to AddDotnetProject; no runtime change.
examples/​sftp/​CommunityToolkit.Aspire.Hosting.Sftp.AppHost/​CommunityToolkit.Aspire.Hosting.Sftp.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​seaweedfs/​SeaweedFS.AppHost/​SeaweedFS.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​rustfs/​CommunityToolkit.Aspire.Hosting.RustFs.AppHost/​CommunityToolkit.Aspire.Hosting.RustFs.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​rust/​CommunityToolkit.Aspire.Hosting.Rust.AppHost/​CommunityToolkit.Aspire.Hosting.Rust.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​redpanda/​CommunityToolkit.Aspire.Hosting.RedPanda.AppHost/​CommunityToolkit.Aspire.Hosting.RedPanda.AppHost.csproj Migrates SDK/packages; explicitly marks the consumer resource reference.
examples/​redis-ext/​CommunityToolkit.Aspire.Hosting.Redis.Extensions.AppHost/​CommunityToolkit.Aspire.Hosting.Redis.Extensions.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​ravendb/​RavenDB.AppHost/​CommunityToolkit.Aspire.Hosting.RavenDB.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​python/​CommunityToolkit.Aspire.Hosting.Python.Extensions.AppHost/​CommunityToolkit.Aspire.Hosting.Python.Extensions.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​powershell/​CommunityToolkit.Aspire.PowerShell.AppHost/​CommunityToolkit.Aspire.PowerShell.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​postgres-ext/​CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions.AppHost/​CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​posta/​CommunityToolkit.Aspire.Hosting.Posta.AppHost/​CommunityToolkit.Aspire.Hosting.Posta.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​perl/​CpanmApiIntegration.AppHost/​CpanmApiIntegration.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​papercut/​CommunityToolkit.Aspire.Hosting.PapercutSmtp.AppHost/​CommunityToolkit.Aspire.Hosting.PapercutSmtp.AppHost.csproj Migrates SDK/packages; explicitly marks the mail API resource reference.
examples/​opentelemetry-collector/​CommunityToolkit.Aspire.Hosting.OpenTelemetryCollector.AppHost/​CommunityToolkit.Aspire.Hosting.OpenTelemetryCollector.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​ollama/​CommunityToolkit.Aspire.Hosting.Ollama.AppHost/​CommunityToolkit.Aspire.Hosting.Ollama.AppHost.csproj Migrates SDK/packages; explicitly marks the web resource reference.
examples/​ngrok/​CommunityToolkit.Aspire.Hosting.Ngrok.AppHost/​CommunityToolkit.Aspire.Hosting.Ngrok.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​mysql-ext/​CommunityToolkit.Aspire.Hosting.MySql.Extensions.AppHost/​CommunityToolkit.Aspire.Hosting.MySql.Extensions.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​mosquitto/​CommunityToolkit.Aspire.Hosting.Mosquitto.AppHost/​CommunityToolkit.Aspire.Hosting.Mosquitto.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​mongodb-ext/​CommunityToolkit.Aspire.Hosting.MongoDB.Extensions.AppHost/​CommunityToolkit.Aspire.Hosting.MongoDB.Extensions.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​meilisearch/​CommunityToolkit.Aspire.Hosting.Meilisearch.AppHost/​CommunityToolkit.Aspire.Hosting.Meilisearch.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​mcp-inspector/​CommunityToolkit.Aspire.Hosting.McpInspector.AppHost/​CommunityToolkit.Aspire.Hosting.McpInspector.AppHost.csproj Migrates SDK/packages; explicitly marks the MCP server resource reference.
examples/​masstransit-rabbitmq/​CommunityToolkit.Aspire.Hosting.MassTransit.RabbitMQ.AppHost/​CommunityToolkit.Aspire.Hosting.MassTransit.RabbitMQ.AppHost.csproj Migrates SDK/packages; explicitly marks API and publisher resource references.
examples/​mailpit/​CommunityToolkit.Aspire.Hosting.MailPit.AppHost/​CommunityToolkit.Aspire.Hosting.MailPit.AppHost.csproj Migrates SDK/packages; explicitly marks the mail API resource reference.
examples/​loki/​CommunityToolkit.Aspire.Hosting.Loki.AppHost/​CommunityToolkit.Aspire.Hosting.Loki.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​logto/​CommunityToolkit.Aspire.Hosting.Logto.AppHost/​CommunityToolkit.Aspire.Hosting.Logto.AppHost.csproj Migrates SDK/packages; explicitly marks both client resource references.
examples/​listmonk/​CommunityToolkit.Aspire.Hosting.Listmonk.AppHost/​CommunityToolkit.Aspire.Hosting.Listmonk.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​lavinmq/​CommunityToolkit.Aspire.Hosting.LavinMQ.AppHost/​CommunityToolkit.Aspire.Hosting.LavinMQ.AppHost.csproj Migrates SDK/packages; explicitly marks the MassTransit resource reference.
examples/​kurrentdb/​CommunityToolkit.Aspire.Hosting.KurrentDB.AppHost/​CommunityToolkit.Aspire.Hosting.KurrentDB.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​kind/​CommunityToolkit.Aspire.Hosting.Kind.Publish.AppHost/​CommunityToolkit.Aspire.Hosting.Kind.Publish.AppHost.csproj Migrates the publishing example’s SDK and hosting packages.
examples/​kind/​CommunityToolkit.Aspire.Hosting.Kind.AppHost/​CommunityToolkit.Aspire.Hosting.Kind.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​keycloak-postgres/​CommunityToolkit.Aspire.Hosting.Keycloak.Extensions.AppHost/​CommunityToolkit.Aspire.Hosting.Keycloak.Extensions.AppHost.csproj Migrates SDK/packages; explicitly marks development and production resource references.
examples/​k6/​CommunityToolkit.Aspire.Hosting.k6.AppHost/​CommunityToolkit.Aspire.Hosting.k6.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​k3s/​CommunityToolkit.Aspire.Hosting.K3s.AppHost/​CommunityToolkit.Aspire.Hosting.K3s.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​javascript-ext/​CommunityToolkit.Aspire.Hosting.JavaScript.Extensions.AppHost/​CommunityToolkit.Aspire.Hosting.JavaScript.Extensions.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​java/​CommunityToolkit.Aspire.Hosting.Java.AppHost/​CommunityToolkit.Aspire.Hosting.Java.AppHost.csproj Migrates SDK/packages; explicitly marks API and web resource references.
examples/​goff/​CommunityToolkit.Aspire.Hosting.GoFeatureFlag.AppHost/​CommunityToolkit.Aspire.Hosting.GoFeatureFlag.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​flyway/​03.Repair/​03.Repair.csproj Migrates the repair example’s SDK and hosting packages.
examples/​flyway/​02.ContainerConfiguration/​02.ContainerConfiguration.csproj Migrates the container-configuration example’s SDK and hosting packages.
examples/​flyway/​01.Basic/​01.Basic.csproj Migrates the basic example’s SDK and hosting packages.
examples/​floci/​CommunityToolkit.Aspire.Hosting.Floci.AppHost/​CommunityToolkit.Aspire.Hosting.Floci.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​flare/​CommunityToolkit.Aspire.Hosting.Flare.AppHost/​CommunityToolkit.Aspire.Hosting.Flare.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​flagd/​CommunityToolkit.Aspire.Hosting.Flagd.AppHost/​CommunityToolkit.Aspire.Hosting.Flagd.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​elasticsearch-ext/​CommunityToolkit.Aspire.Hosting.Elasticsearch.Extensions.AppHost/​CommunityToolkit.Aspire.Hosting.Elasticsearch.Extensions.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​duckdb/​CommunityToolkit.Aspire.DuckDB.AppHost/​CommunityToolkit.Aspire.DuckDB.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​deno/​CommunityToolkit.Aspire.Hosting.Deno.AppHost/​CommunityToolkit.Aspire.Hosting.Deno.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​dbx/​CommunityToolkit.Aspire.Hosting.Dbx.AppHost/​CommunityToolkit.Aspire.Hosting.Dbx.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​dbgate/​CommunityToolkit.Aspire.Hosting.DbGate.AppHost/​CommunityToolkit.Aspire.Hosting.DbGate.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​data-api-builder/​CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder.AppHost/​CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder.AppHost.csproj Migrates SDK/packages; explicitly marks the Blazor resource reference.
examples/​dapr/​CommunityToolkit.Aspire.Hosting.Dapr.AppHost/​CommunityToolkit.Aspire.Hosting.Dapr.AppHost.csproj Migrates SDK/packages; explicitly marks all three service resource references.
examples/​dapr/​CommunityToolkit.Aspire.Hosting.Azure.Dapr.AppHost/​CommunityToolkit.Aspire.Hosting.Azure.Dapr.AppHost.csproj Migrates SDK/packages; explicitly marks all three service resource references.
examples/​chromadb/​CommunityToolkit.Aspire.Hosting.Chroma.AppHost/​CommunityToolkit.Aspire.Hosting.Chroma.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​bitwarden-secret-manager/​CommunityToolkit.Aspire.Hosting.Bitwarden.SecretManager.AppHost/​CommunityToolkit.Aspire.Hosting.Bitwarden.SecretManager.AppHost.csproj Migrates SDK/packages; explicitly marks the API resource reference.
examples/​azure-ext/​CommunityToolkit.Aspire.Azure.Extensions.AppHost/​CommunityToolkit.Aspire.Azure.Extensions.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​agents/​CommunityToolkit.Aspire.Hosting.Agents.AppHost/​CommunityToolkit.Aspire.Hosting.Agents.AppHost.csproj Migrates SDK/packages; explicitly marks three agent project resource references.
examples/​adminer/​CommunityToolkit.Aspire.Hosting.Adminer.AppHost/​CommunityToolkit.Aspire.Hosting.Adminer.AppHost.csproj Migrates SDK and declares hosting packages.
examples/​activemq/​CommunityToolkit.Aspire.Hosting.ActiveMQ.AppHost/​CommunityToolkit.Aspire.Hosting.ActiveMQ.AppHost.csproj Migrates SDK/packages; explicitly marks the MassTransit resource reference.
docs/​setup.md Documents package-based AppHosts and central version management.
Directory.Packages.props Adds the central Aspire.Hosting.AppHost version entry.
.github/​workflows/​aspire-upgrade.md Updates upgrade guidance to discover AppHost packages and verify central pins.
.agents/​skills/​aspire-upgrade/​SKILL.md Aligns the upgrade skill with package-based AppHost version management.

Review effort: Balanced

@FullStackChef FullStackChef 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.

Reviewed 56394d0 independently. The 68 AppHost package migrations and 47 explicit resource-reference targets audit consistently, and Windows/Linux builds pass. However, the shared testing-library migration breaks runtime test-builder discovery (inline finding). Please preserve the required AppHost metadata for that helper and rerun affected runtime tests before approval. I inspected CI logs rather than running .NET locally. Reviewed by Riley on behalf of FullStackChef. No merge performed.

@aaronpowell aaronpowell mentioned this pull request Nov 18, 2026
6 of 10 tasks
aaronpowell and others added 3 commits November 19, 2026 10:07
Reference Aspire.Hosting.AppHost explicitly so its supported build targets emit DCP and AppHost assembly metadata for non-generic testing builders. Cover run and publish model creation without loading an example AppHost.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep consumer metadata while removing the obsolete SDK from the example and test hosts added on main after the original migration.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@aaronpowell
aaronpowell enabled auto-merge (squash) November 18, 2026 23:42
@aaronpowell
aaronpowell disabled auto-merge November 18, 2026 23:47
@aaronpowell
aaronpowell merged commit c4df358 into CommunityToolkit:main Nov 18, 2026
178 checks passed
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.

4 participants