Improve apphost discovery. #8892
Merged
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 the
src/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.json
file 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.json
path 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.