File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
src/BuiltInTools/dotnet-watch/Aspire
TestAssets/TestProjects/WatchAspire/WatchAspire.ApiService
dotnet-watch.Tests/HotReload Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ private ProjectOptions GetProjectOptions(ProjectLaunchRequest projectLaunchInfo)
211
211
{
212
212
IsRootProject = false ,
213
213
ProjectPath = projectLaunchInfo . ProjectPath ,
214
- WorkingDirectory = _projectLauncher . EnvironmentOptions . WorkingDirectory ,
214
+ WorkingDirectory = Path . GetDirectoryName ( projectLaunchInfo . ProjectPath ) ?? throw new InvalidOperationException ( ) ,
215
215
BuildArguments = _hostProjectOptions . BuildArguments ,
216
216
Command = "run" ,
217
217
CommandArguments = GetRunCommandArguments ( projectLaunchInfo , hostLaunchProfile ) ,
Original file line number Diff line number Diff line change
1
+ using System ;
2
+
1
3
var builder = WebApplication . CreateBuilder ( args ) ;
2
4
5
+ Console . WriteLine ( $ "ApiService working directory: '{ Environment . CurrentDirectory } '") ;
6
+
3
7
// Add service defaults & Aspire components.
4
8
builder . AddServiceDefaults ( ) ;
5
9
Original file line number Diff line number Diff line change @@ -1054,6 +1054,9 @@ public async Task Aspire_BuildError_ManualRestart()
1054
1054
// wait until after DCP session started:
1055
1055
await App . WaitUntilOutputContains ( "dotnet watch ⭐ Session started: #1" ) ;
1056
1056
1057
+ // working directory of the service should be it's project directory:
1058
+ await App . WaitUntilOutputContains ( $ "ApiService working directory: '{ Path . GetDirectoryName ( serviceProjectPath ) } '") ;
1059
+
1057
1060
// Service -- valid code change:
1058
1061
UpdateSourceFile (
1059
1062
serviceSourcePath ,
@@ -1078,7 +1081,7 @@ public async Task Aspire_BuildError_ManualRestart()
1078
1081
await App . AssertOutputLineStartsWith ( " ❔ Do you want to restart these projects? Yes (y) / No (n) / Always (a) / Never (v)" ) ;
1079
1082
1080
1083
App . AssertOutputContains ( "dotnet watch ⌚ Restart is needed to apply the changes." ) ;
1081
- App . AssertOutputContains ( $ "dotnet watch ❌ { serviceSourcePath } (36 ,1): error ENC0020: Renaming record 'WeatherForecast' requires restarting the application.") ;
1084
+ App . AssertOutputContains ( $ "dotnet watch ❌ { serviceSourcePath } (40 ,1): error ENC0020: Renaming record 'WeatherForecast' requires restarting the application.") ;
1082
1085
App . AssertOutputContains ( "dotnet watch ⌚ Affected projects:" ) ;
1083
1086
App . AssertOutputContains ( "dotnet watch ⌚ WatchAspire.ApiService" ) ;
1084
1087
App . Process . ClearOutput ( ) ;
You can’t perform that action at this time.
0 commit comments