@@ -103,12 +103,12 @@ public void UsingDotnetForTheFirstTimeWithNonVerbsDoesNotPrintEula()
103103 . StartWith ( firstTimeNonVerbUseMessage ) ;
104104 }
105105
106- [ WindowsOnlyFact ]
106+ [ Fact ]
107107 public void ItShowsTheAppropriateMessageToTheUser ( )
108108 {
109109
110110 var expectedVersion = GetDotnetVersion ( ) ;
111- _fixture . FirstDotnetVerbUseCommandResult . StdOut
111+ _fixture . FirstDotnetVerbUseCommandResult . StdErr
112112 . Should ( )
113113 . ContainVisuallySameFragment ( string . Format (
114114 Configurer . LocalizableStrings . FirstTimeMessageWelcome ,
@@ -118,6 +118,30 @@ public void ItShowsTheAppropriateMessageToTheUser()
118118 . And . NotContain ( "Restore completed in" ) ;
119119 }
120120
121+ [ WindowsOnlyFact ]
122+ public void FirstRunExperienceMessagesShouldGoToStdErr ( )
123+ {
124+ // This test ensures that first-run experience messages go to stderr,
125+ // not stdout, to avoid interfering with completion commands and other
126+ // tools that parse stdout. See: https://github.com/dotnet/sdk/issues/50444
127+ var expectedVersion = GetDotnetVersion ( ) ;
128+
129+ // StdErr should contain first-run messages
130+ _fixture . FirstDotnetVerbUseCommandResult . StdErr
131+ . Should ( )
132+ . ContainVisuallySameFragment ( string . Format (
133+ Configurer . LocalizableStrings . FirstTimeMessageWelcome ,
134+ DotnetFirstTimeUseConfigurer . ParseDotNetVersion ( expectedVersion ) ,
135+ expectedVersion ) )
136+ . And . ContainVisuallySameFragment ( Configurer . LocalizableStrings . FirstTimeMessageMoreInformation ) ;
137+
138+ // StdOut should NOT contain first-run messages (they should only be in stderr)
139+ _fixture . FirstDotnetVerbUseCommandResult . StdOut
140+ . Should ( )
141+ . NotContain ( "Welcome to .NET" )
142+ . And . NotContain ( "Write your first app" ) ;
143+ }
144+
121145 [ Fact ]
122146 public void ItCreatesAFirstUseSentinelFileUnderTheDotDotNetFolder ( )
123147 {
@@ -164,7 +188,7 @@ public void ItShowsTheTelemetryNoticeWhenInvokingACommandAfterInternalReportInst
164188
165189 var expectedVersion = GetDotnetVersion ( ) ;
166190
167- result . StdOut
191+ result . StdErr
168192 . Should ( )
169193 . ContainVisuallySameFragment ( string . Format (
170194 Configurer . LocalizableStrings . FirstTimeMessageWelcome ,
0 commit comments