Improve apphost discovery.#8892
Merged
Merged
Conversation
Contributor
|
Is there a fast path for csproj in the current directory or do I pay for this everytime? |
Member
Author
|
If you invoke |
davidfowl
approved these changes
Apr 22, 2025
This was referenced Apr 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR improves usability of the
aspire [run|add|publish] commands by searching for valid app hosts in sub-directories, using the current working directory as a starting point. Here is a walkthrough video showing it in action. The important thing to note here is that we did not change into thesrc/HelloAspire.AppHost` sub directory in order for this command to work.aspire-recursive-search.mp4
Note that this recursive search behavior can be expensive in projects with a large number of *.csproj files so it is possible to place a
.aspire/settings.jsonfile in the current directory or any parent directory to short-circuit the discovery process and point directly to a well known apphost.Included in this PR is a mechanism whereby this configuration file is automatically dropped in the
<workingdir>/.aspire/settings.jsonpath to avoid subsequent invocations taking as long. The idea is that by the time it becomes a problem in a repository the settings file is present.