AspireHostingSDKVersion is empty in project-file properties for package-based AppHosts
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- csharp
- Domain
- build-system
Research direction
Start in the Aspire.Hosting.AppHost package: compare where AspireHostingSDKVersion is set in Aspire.Hosting.AppHost.targets against the IsAspireHost-keyed defaults already in Aspire.Hosting.AppHost.props. Reproduce with the reported dotnet msbuild -getProperty:AspireHostingSDKVersion -getProperty:VersionedDir on the sample project, then move or mirror the definition into the .props file so it evaluates before the project body. Done when VersionedDir resolves with the version and, if it stays in .targets, the migration docs note the ordering change.
Written by the indexing model from the issue text.
Description
With the package-based AppHost (Microsoft.NET.Sdk + Aspire.Hosting.AppHost), AspireHostingSDKVersion is set in Aspire.Hosting.AppHost.targets. The obsolete Aspire.AppHost.Sdk set it in Sdk.props. Because the package sets it after the project body is evaluated, any property in the project file that uses it gets an empty value. Migrating off the SDK silently changes what those properties evaluate to.
Repro (17.0.0):
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net11.0</TargetFramework>
<VersionedDir>obj/aspire/$(AspireHostingSDKVersion)</VersionedDir>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Aspire.Hosting.AppHost" Version="17.0.0" />
</ItemGroup>
</Project>
$ dotnet msbuild -getProperty:AspireHostingSDKVersion -getProperty:VersionedDir
"AspireHostingSDKVersion": "17.0.0",
"VersionedDir": "obj/aspire/"
The same property worked under Aspire.AppHost.Sdk. I hit it with a version-pinned AspireCliBundlePath like the one above, and the build doesn't warn. The workaround is explicit Sdk.props/Sdk.targets imports, with the property defined after Sdk.targets.
Could the package define it in Aspire.Hosting.AppHost.props, keyed off IsAspireHost like the existing defaults there? If it has to stay in .targets, a mention in the migration docs would help.
- Dominant language
- C#
- Stars
- 6.4k
- Forks
- 1k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 446
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/aspire
-
needs-area-label
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
needs-area-label triage:bot-seen triage:needs-human
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
microsoft/aspire#22535 · 1 comment ·
Maintainers usually reply within 1 day
-
Support a display name when adding a template sourceMay be free again @VidhiyaMuniyan claimed this 7 days ago, and no pull request is open. Openarea-templates triage:bot-seen triage:needs-human
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
microsoft/aspire#22356 · 2 comments ·
Maintainers usually reply within 1 day
-
Clarify that --isolated supports parallel copies of an AppHost in different directoriesMay be free again @VaishuV23 claimed this 7 days ago, and no pull request is open. Openarea-cli documentation triage:bot-seen triage:needs-human
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
microsoft/aspire#22344 · 3 comments ·
Maintainers usually reply within 1 day
-
Copilot telemetry hook write replaces all of ~/.copilot/hooks/aspire-telemetry.jsonPossibly taken @anandt1201 claimed this 7 days ago. Openneeds-area-label
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
All issues in microsoft/aspire
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
dotnet-outdated/dotnet-outdated#871 ·
Maintainers usually reply within 1 day
-
triage/untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
unoplatform/uno#26676 ·
Maintainers usually reply within 1 day
-
.NET bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
jhaizhou-ops/S2Arm#2177 · 3 comments ·
Maintainers usually reply within 1 day
-
area-CodeGen-coreclr untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
dotnet/runtime#138181 · 1 comment ·
Maintainers usually reply within 1 day