Remove redundant Path.GetDirectoryName call and rename _appPath/_AppPath to _appDirectoryPath/AppDirectoryPath in PrebuiltAppHostServer#15332
Merged
joperezr merged 3 commits intorelease/13.2from Mar 18, 2026
Conversation
…yPath in PrebuiltAppHostServer Co-authored-by: eerhardt <8291187+eerhardt@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
eerhardt
March 17, 2026 20:09
View session
eerhardt
reviewed
Mar 17, 2026
…and implementations Co-authored-by: eerhardt <8291187+eerhardt@users.noreply.github.com>
Contributor
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Copilot
AI
changed the title
Remove redundant Path.GetDirectoryName call and rename _appPath to _appDirectoryPath in PrebuiltAppHostServer
Remove redundant Path.GetDirectoryName call and rename _appPath/_AppPath to _appDirectoryPath/AppDirectoryPath in PrebuiltAppHostServer
Mar 17, 2026
eerhardt
approved these changes
Mar 17, 2026
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15332Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15332" |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR clarifies and standardizes “app path” semantics for CLI AppHost server projects by treating the value as a directory path and removing redundant/incorrect Path.GetDirectoryName usage.
Changes:
- Renamed
AppPath→AppDirectoryPathonIAppHostServerProjectand updated implementations. - Renamed
PrebuiltAppHostServer’s backing field to_appDirectoryPathand removed redundantPath.GetDirectoryNamecall sites. - Simplified NuGet restore/config loading to operate directly on the app host directory path.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Aspire.Cli/Projects/PrebuiltAppHostServer.cs | Renames internal storage to _appDirectoryPath and uses it directly for NuGet restore working directory and local .aspire/settings.json loading. |
| src/Aspire.Cli/Projects/IAppHostServerProject.cs | Renames the interface property to AppDirectoryPath to reflect directory semantics. |
| src/Aspire.Cli/Projects/DotNetBasedAppHostServerProject.cs | Updates the implementation to expose AppDirectoryPath (mapped to existing normalized _appPath). |
adamint
approved these changes
Mar 17, 2026
davidfowl
approved these changes
Mar 18, 2026
Copilot AI
added a commit
that referenced
this pull request
Mar 18, 2026
…ath to _appDirectoryPath/AppDirectoryPath in PrebuiltAppHostServer (#15332) * Initial plan * Remove Path.GetDirectoryName call and rename _appPath to _appDirectoryPath in PrebuiltAppHostServer Co-authored-by: eerhardt <8291187+eerhardt@users.noreply.github.com> * Rename AppPath property to AppDirectoryPath in IAppHostServerProject and implementations Co-authored-by: eerhardt <8291187+eerhardt@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: eerhardt <8291187+eerhardt@users.noreply.github.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Customer Impact
With aspire polyglot,
NuGet.configfiles in the same directory as the apphost aren't respected.Description
_appPathinPrebuiltAppHostServeralready holds a directory path, making thePath.GetDirectoryNamecalls redundant. This cleans up two such callsites, renames the private field to_appDirectoryPath, and renames the public propertyAppPathtoAppDirectoryPathto accurately reflect their semantics.Changes in
PrebuiltAppHostServer.cs:_appPath→_appDirectoryPaththroughoutAppPathproperty →AppDirectoryPathRestoreNuGetPackagesAsync: removed intermediateappHostDirectorylocal and pass_appDirectoryPathdirectly asworkingDirectoryResolveChannelNameAsync: removedPath.GetDirectoryName(_appPath)!and pass_appDirectoryPathdirectly toAspireJsonConfiguration.LoadChanges in
IAppHostServerProject.cs:AppPathproperty →AppDirectoryPathChanges in
DotNetBasedAppHostServerProject.cs:AppPathproperty →AppDirectoryPathBefore:
After:
Checklist
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.