@@ -103,12 +103,12 @@ public void UsingDotnetForTheFirstTimeWithNonVerbsDoesNotPrintEula()
103
103
. StartWith ( firstTimeNonVerbUseMessage ) ;
104
104
}
105
105
106
- [ WindowsOnlyFact ]
106
+ [ Fact ]
107
107
public void ItShowsTheAppropriateMessageToTheUser ( )
108
108
{
109
109
110
110
var expectedVersion = GetDotnetVersion ( ) ;
111
- _fixture . FirstDotnetVerbUseCommandResult . StdOut
111
+ _fixture . FirstDotnetVerbUseCommandResult . StdErr
112
112
. Should ( )
113
113
. ContainVisuallySameFragment ( string . Format (
114
114
Configurer . LocalizableStrings . FirstTimeMessageWelcome ,
@@ -118,6 +118,30 @@ public void ItShowsTheAppropriateMessageToTheUser()
118
118
. And . NotContain ( "Restore completed in" ) ;
119
119
}
120
120
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
+
121
145
[ Fact ]
122
146
public void ItCreatesAFirstUseSentinelFileUnderTheDotDotNetFolder ( )
123
147
{
@@ -164,7 +188,7 @@ public void ItShowsTheTelemetryNoticeWhenInvokingACommandAfterInternalReportInst
164
188
165
189
var expectedVersion = GetDotnetVersion ( ) ;
166
190
167
- result . StdOut
191
+ result . StdErr
168
192
. Should ( )
169
193
. ContainVisuallySameFragment ( string . Format (
170
194
Configurer . LocalizableStrings . FirstTimeMessageWelcome ,
0 commit comments