Skip to content

Use project directory as a working directory for Aspire processes #49901

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tmat
Copy link
Member

@tmat tmat commented Jul 22, 2025

@Copilot Copilot AI review requested due to automatic review settings July 22, 2025 17:36
@tmat tmat requested a review from a team as a code owner July 22, 2025 17:36
@github-actions github-actions bot added the Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch label Jul 22, 2025
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.

Pull Request Overview

This PR fixes an issue where Aspire processes were using an incorrect working directory by ensuring each service uses its project directory as the working directory. The change addresses issue #9142 by modifying how the working directory is determined for Aspire service processes.

Key changes:

  • Modified AspireServiceFactory to use the project's directory instead of the host project's working directory
  • Added test verification to ensure the working directory is correctly set
  • Added console output to the test service to verify the working directory behavior

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/BuiltInTools/dotnet-watch/Aspire/AspireServiceFactory.cs Changes working directory logic to use project directory instead of host working directory
test/TestAssets/TestProjects/WatchAspire/WatchAspire.ApiService/Program.cs Adds console output to display current working directory for test verification
test/dotnet-watch.Tests/HotReload/ApplyDeltaTests.cs Adds test assertion to verify working directory is set correctly

Copy link
Contributor

Thanks for your PR, @@tmat.
To learn about the PR process and branching schedule of this repo, please take a look at the SDK PR Guide.

@tmat tmat force-pushed the AspireWorkingDir branch from f0fabff to 3f2707d Compare July 23, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Azure Functions project starts with incorrect working directory via dotnet watch
2 participants