Skip to content

Centralize Aspire.AppHost.Sdk version to enable Dependabot updates and avoid SDK downgrade errors #112

@SebastienDegodez

Description

@SebastienDegodez

Currently, our project sets the Aspire.AppHost.Sdk version directly as an attribute in the .csproj files (e.g. <Project Sdk="Aspire.AppHost.Sdk/13.0.0">). This leads to two issues:

  1. Dependabot cannot update the version when security or compatibility updates are available, since it does not manage versioned SDK attributes in csproj files.
  2. Renovate or manual PRs can cause a mismatch between the Aspire packages in Directory.Packages.props (e.g. Aspire.Hosting, Aspire.Hosting.Testing, etc.) and the AppHost SDK, resulting in NU1605 package downgrade errors during builds.

Proposed solution

  • Move Aspire.AppHost.Sdk versioning to the msbuild-sdks section of global.json (supported by .NET 8+).
  • Change all <Project Sdk="Aspire.AppHost.Sdk/13.x.x"> lines to <Project Sdk="Aspire.AppHost.Sdk">.
  • Remove any hardcoded AppHost.Sdk entries from Directory.Packages.props.
  • Document this in the contributing guide (if present).

Benefits

  • Dependabot will now automatically update the SDK version along with the NuGet Aspire packages.
  • Eliminates package downgrade errors when bumping Aspire components.
  • Simplifies future Aspire upgrades and maintenance.

Acceptance criteria

  • The version for Aspire.AppHost.Sdk is set only in global.json.
  • All .csproj and Directory.Packages.props files are updated as above.
  • Dependabot PRs succeed when Aspire versions are updated.

See PR #111 for a relevant scenario and motivation.

/cc @SebastienDegodez

Metadata

Metadata

Labels

.NETPull requests that update .NET codedependenciesPull requests that update a dependency filekind/bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions