Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving property IsAspireHost to the SDK #8144

Merged
merged 1 commit into from
Mar 19, 2025
Merged

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

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Copy link
Contributor

@Copilot 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants