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:
- Dependabot cannot update the version when security or compatibility updates are available, since it does not manage versioned SDK attributes in csproj files.
- 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
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:Proposed solution
msbuild-sdkssection ofglobal.json(supported by .NET 8+).<Project Sdk="Aspire.AppHost.Sdk/13.x.x">lines to<Project Sdk="Aspire.AppHost.Sdk">.Benefits
Acceptance criteria
See PR #111 for a relevant scenario and motivation.
/cc @SebastienDegodez