Skip to content

Conversation

@joperezr
Copy link
Member

@joperezr joperezr commented Mar 18, 2025

Description

When we introduced the Aspire SDK, we tried to minimize the changes to the AppHost templates for backward compatibility, which meant that the definition of IsAspireHost stayed in the AppHost file. This could sometimes cause issues when restore wouldn't succeed the first time (like #7977) so this change is finally moving that property from the AppHost and into the SDK to avoid those types of issues.

cc: @DamianEdwards

Fixes #7977
Fixes #6142

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • No
  • Did you add public API?
    • No
  • Does the change make any security assumptions or guarantees?
    • No

Tracking docs update issue: dotnet/docs-aspire#2847

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

Files not reviewed (4)
  • src/Aspire.AppHost.Sdk/SDK/Sdk.in.props: Language not supported
  • src/Aspire.ProjectTemplates/templates/aspire-apphost/9.2/Aspire.AppHost1.csproj: Language not supported
  • src/Aspire.ProjectTemplates/templates/aspire-empty/9.2/AspireApplication.1.AppHost/AspireApplication.1.AppHost.csproj: Language not supported
  • src/Aspire.ProjectTemplates/templates/aspire-starter/9.2/Aspire-StarterApplication.1.AppHost/Aspire-StarterApplication.1.AppHost.csproj: Language not supported

@DamianEdwards
Copy link
Member

What does this property actually do now then? What is looking at it?

@joperezr
Copy link
Member Author

What does this property actually do now then? What is looking at it?

Several things in our apphost targets as well as sdk targets use it to drive some of their functionality. https://github.com/search?q=repo%3Adotnet%2Faspire%20%22%24(IsAspireHost)%22&type=code

That can get refactored to not use the property, but some scenarios might get a bit messy and would require some logic that might be a bit more complex. For instance, if you have a project that references an AppHost, it imports some of these props and targets and so now we would need to make sure that we condition the logic right such that it doesn't start behaving like an AppHost.

@joperezr joperezr merged commit 307334e into dotnet:main Mar 19, 2025
165 checks passed
@joperezr joperezr deleted the IsAspireHost2 branch April 1, 2025 17:43
@github-actions github-actions bot locked and limited conversation to collaborators May 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dotnet restore incorrectly recommends installing aspire workload when nuget feeds are messed up Unclear error if you remove IsAspireHost from csproj

4 participants