@@ -249,9 +249,8 @@ class AppUpdateHandler
249
249
250
250
await App . AssertOutputLineStartsWith ( "Updated" ) ;
251
251
252
- AssertEx . Contains (
253
- "dotnet watch ⚠ [WatchHotReloadApp (net9.0)] Expected to find a static method 'ClearCache' or 'UpdateApplication' on type 'AppUpdateHandler, WatchHotReloadApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' but neither exists." ,
254
- App . Process . Output ) ;
252
+ await App . WaitUntilOutputContains (
253
+ $ "dotnet watch ⚠ [WatchHotReloadApp ({ ToolsetInfo . CurrentTargetFramework } )] Expected to find a static method 'ClearCache' or 'UpdateApplication' on type 'AppUpdateHandler, WatchHotReloadApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' but neither exists.") ;
255
254
}
256
255
257
256
[ Theory ]
@@ -290,13 +289,11 @@ class AppUpdateHandler
290
289
291
290
await App . AssertOutputLineStartsWith ( "Updated" ) ;
292
291
293
- AssertEx . Contains (
294
- "dotnet watch ⚠ [WatchHotReloadApp (net9.0)] Exception from 'System.Action`1[System.Type[]]': System.InvalidOperationException: Bug!" ,
295
- App . Process . Output ) ;
292
+ await App . WaitUntilOutputContains ( $ "dotnet watch ⚠ [WatchHotReloadApp ({ ToolsetInfo . CurrentTargetFramework } )] Exception from 'System.Action`1[System.Type[]]': System.InvalidOperationException: Bug!") ;
296
293
297
294
if ( verbose )
298
295
{
299
- AssertEx . Contains ( "dotnet watch 🕵️ [WatchHotReloadApp (net9.0 )] Deltas applied." , App . Process . Output ) ;
296
+ await App . WaitUntilOutputContains ( $ "dotnet watch 🕵️ [WatchHotReloadApp ({ ToolsetInfo . CurrentTargetFramework } )] Deltas applied.") ;
300
297
}
301
298
else
302
299
{
@@ -352,7 +349,7 @@ public async Task BlazorWasm(bool projectSpecifiesCapabilities)
352
349
""" ;
353
350
354
351
UpdateSourceFile ( Path . Combine ( testAsset . Path , "Pages" , "Index.razor" ) , newSource ) ;
355
- await App . AssertOutputLineStartsWith ( MessageDescriptor . HotReloadSucceeded , "blazorwasm (net9.0 )" ) ;
352
+ await App . AssertOutputLineStartsWith ( MessageDescriptor . HotReloadSucceeded , $ "blazorwasm ({ ToolsetInfo . CurrentTargetFramework } )") ;
356
353
357
354
// check project specified capapabilities:
358
355
if ( projectSpecifiesCapabilities )
@@ -415,8 +412,8 @@ public async Task Razor_Component_ScopedCssAndStaticAssets()
415
412
await App . AssertOutputLineStartsWith ( "dotnet watch 🔥 Hot reload change handled" ) ;
416
413
417
414
App . AssertOutputContains ( $ "dotnet watch ⌚ Handling file change event for scoped css file { scopedCssPath } .") ;
418
- App . AssertOutputContains ( $ "dotnet watch ⌚ [RazorClassLibrary (net9.0 )] No refresh server.") ;
419
- App . AssertOutputContains ( $ "dotnet watch ⌚ [RazorApp (net9.0 )] Refreshing browser.") ;
415
+ App . AssertOutputContains ( $ "dotnet watch ⌚ [RazorClassLibrary ({ ToolsetInfo . CurrentTargetFramework } )] No refresh server.") ;
416
+ App . AssertOutputContains ( $ "dotnet watch ⌚ [RazorApp ({ ToolsetInfo . CurrentTargetFramework } )] Refreshing browser.") ;
420
417
App . AssertOutputContains ( $ "dotnet watch 🔥 Hot reload of scoped css succeeded.") ;
421
418
App . AssertOutputContains ( $ "dotnet watch ⌚ No C# changes to apply.") ;
422
419
App . Process . ClearOutput ( ) ;
@@ -427,7 +424,7 @@ public async Task Razor_Component_ScopedCssAndStaticAssets()
427
424
await App . AssertOutputLineStartsWith ( "dotnet watch 🔥 Hot reload change handled" ) ;
428
425
429
426
App . AssertOutputContains ( $ "dotnet watch ⌚ Sending static file update request for asset 'app.css'.") ;
430
- App . AssertOutputContains ( $ "dotnet watch ⌚ [RazorApp (net9.0 )] Refreshing browser.") ;
427
+ App . AssertOutputContains ( $ "dotnet watch ⌚ [RazorApp ({ ToolsetInfo . CurrentTargetFramework } )] Refreshing browser.") ;
431
428
App . AssertOutputContains ( $ "dotnet watch 🔥 Hot Reload of static files succeeded.") ;
432
429
App . AssertOutputContains ( $ "dotnet watch ⌚ No C# changes to apply.") ;
433
430
App . Process . ClearOutput ( ) ;
@@ -625,6 +622,7 @@ public static void PrintDirectoryName([CallerFilePathAttribute] string filePath
625
622
[ Fact ( Skip = "https://github.com/dotnet/sdk/issues/42850" ) ]
626
623
public async Task Aspire ( )
627
624
{
625
+ var tfm = ToolsetInfo . CurrentTargetFramework ;
628
626
var testAsset = TestAssets . CopyTestAsset ( "WatchAspire" )
629
627
. WithSource ( ) ;
630
628
@@ -650,8 +648,8 @@ public async Task Aspire()
650
648
await App . AssertOutputLineStartsWith ( "dotnet watch 🔥 Hot reload change handled" ) ;
651
649
652
650
App . AssertOutputContains ( "Using Aspire process launcher." ) ;
653
- App . AssertOutputContains ( MessageDescriptor . HotReloadSucceeded , "WatchAspire.AppHost (net10.0 )" ) ;
654
- App . AssertOutputContains ( MessageDescriptor . HotReloadSucceeded , "WatchAspire.ApiService (net10.0 )" ) ;
651
+ App . AssertOutputContains ( MessageDescriptor . HotReloadSucceeded , $ "WatchAspire.AppHost ({ tfm } )") ;
652
+ App . AssertOutputContains ( MessageDescriptor . HotReloadSucceeded , $ "WatchAspire.ApiService ({ tfm } )") ;
655
653
656
654
// Only one browser should be launched (dashboard). The child process shouldn't launch a browser.
657
655
Assert . Equal ( 1 , App . Process . Output . Count ( line => line . StartsWith ( "dotnet watch ⌚ Launching browser: " ) ) ) ;
@@ -677,16 +675,16 @@ public async Task Aspire()
677
675
// We don't have means to gracefully terminate process on Windows, see https://github.com/dotnet/runtime/issues/109432
678
676
if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
679
677
{
680
- App . AssertOutputContains ( "dotnet watch ❌ [WatchAspire.ApiService (net9.0 )] Exited with error code -1" ) ;
678
+ App . AssertOutputContains ( $ "dotnet watch ❌ [WatchAspire.ApiService ({ tfm } )] Exited with error code -1") ;
681
679
}
682
680
else
683
681
{
684
682
// Unix process may return exit code = 128 + SIGTERM
685
- // dotnet watch ❌ [WatchAspire.ApiService (net9.0)] Exited with error code 143
686
- App . AssertOutputContains ( "[WatchAspire.ApiService (net9.0 )] Exited" ) ;
683
+ // Exited with error code 143
684
+ App . AssertOutputContains ( $ "[WatchAspire.ApiService ({ tfm } )] Exited") ;
687
685
}
688
686
689
- App . AssertOutputContains ( $ "dotnet watch ⌚ Building ' { serviceProjectPath } ' ...") ;
687
+ App . AssertOutputContains ( $ "dotnet watch ⌚ Building { serviceProjectPath } ...") ;
690
688
App . AssertOutputContains ( "error CS0246: The type or namespace name 'WeatherForecast' could not be found" ) ;
691
689
App . Process . ClearOutput ( ) ;
692
690
@@ -695,9 +693,9 @@ public async Task Aspire()
695
693
serviceSourcePath ,
696
694
originalSource . Replace ( "WeatherForecast" , "WeatherForecast2" ) ) ;
697
695
698
- await App . AssertOutputLineStartsWith ( "dotnet watch ⌚ [WatchAspire.ApiService (net9.0 )] Capabilities" ) ;
696
+ await App . AssertOutputLineStartsWith ( $ "dotnet watch ⌚ [WatchAspire.ApiService ({ tfm } )] Capabilities") ;
699
697
700
- App . AssertOutputContains ( "dotnet watch ⌚ Build succeeded. " ) ;
698
+ App . AssertOutputContains ( $ "dotnet watch 🔨 Build succeeded: { serviceProjectPath } ") ;
701
699
App . AssertOutputContains ( "dotnet watch 🔥 Project baselines updated." ) ;
702
700
App . AssertOutputContains ( $ "dotnet watch ⭐ Starting project: { serviceProjectPath } ") ;
703
701
@@ -708,15 +706,15 @@ public async Task Aspire()
708
706
// We don't have means to gracefully terminate process on Windows, see https://github.com/dotnet/runtime/issues/109432
709
707
if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
710
708
{
711
- await App . AssertOutputLineStartsWith ( "dotnet watch ❌ [WatchAspire.ApiService (net9.0 )] Exited with error code -1" ) ;
712
- await App . AssertOutputLineStartsWith ( "dotnet watch ❌ [WatchAspire.AppHost (net9.0 )] Exited with error code -1" ) ;
709
+ await App . AssertOutputLineStartsWith ( $ "dotnet watch ❌ [WatchAspire.ApiService ({ tfm } )] Exited with error code -1") ;
710
+ await App . AssertOutputLineStartsWith ( $ "dotnet watch ❌ [WatchAspire.AppHost ({ tfm } )] Exited with error code -1") ;
713
711
}
714
712
else
715
713
{
716
714
// Unix process may return exit code = 128 + SIGTERM
717
- // dotnet watch ❌ [WatchAspire.ApiService (net9.0)] Exited with error code 143
718
- await App . AssertOutputLine ( line => line . Contains ( "[WatchAspire.ApiService (net9.0 )] Exited" ) , failure : _ => false ) ;
719
- await App . AssertOutputLine ( line => line . Contains ( "[WatchAspire.AppHost (net9.0 )] Exited" ) , failure : _ => false ) ;
715
+ // Exited with error code 143
716
+ await App . AssertOutputLine ( line => line . Contains ( $ "[WatchAspire.ApiService ({ tfm } )] Exited") , failure : _ => false ) ;
717
+ await App . AssertOutputLine ( line => line . Contains ( $ "[WatchAspire.AppHost ({ tfm } )] Exited") , failure : _ => false ) ;
720
718
}
721
719
722
720
await App . AssertOutputLineStartsWith ( "dotnet watch ⭐ Waiting for server to shutdown ..." ) ;
0 commit comments