@@ -69,6 +69,12 @@ public class RunCommand
69
69
public string ? LaunchProfile { get ; }
70
70
public bool NoLaunchProfile { get ; }
71
71
72
+ /// <summary>
73
+ /// The verbosity of the run-portion of this command specifically. If implicit builds are performed, they will always happen
74
+ /// at a quiet verbosity by default, but it's important that we enable separate verbosity for the run command itself.
75
+ /// </summary>
76
+ public VerbosityOptions RunCommandVerbosity { get ; private set ; }
77
+
72
78
/// <summary>
73
79
/// True to ignore command line arguments specified by launch profile.
74
80
/// </summary>
@@ -208,7 +214,7 @@ internal bool TryGetLaunchProfileSettingsIfNeeded(out ProjectLaunchSettingsModel
208
214
return true ;
209
215
}
210
216
211
- if ( MSBuildArgs . Verbosity ? . IsQuiet ( ) != true )
217
+ if ( ! RunCommandVerbosity . IsQuiet ( ) )
212
218
{
213
219
Reporter . Output . WriteLine ( string . Format ( CliCommandStrings . UsingLaunchSettingsFromMessage , launchSettingsPath ) ) ;
214
220
}
@@ -339,11 +345,20 @@ private MSBuildArgs SetupSilentBuildArgs(MSBuildArgs msbuildArgs)
339
345
{
340
346
msbuildArgs = msbuildArgs . CloneWithAdditionalArgs ( "-nologo" ) ;
341
347
342
- if ( msbuildArgs . Verbosity is null )
348
+ if ( msbuildArgs . Verbosity is VerbosityOptions userVerbosity )
349
+ {
350
+ // if the user had a desired verbosity, we use that for the run command
351
+ RunCommandVerbosity = userVerbosity ;
352
+ return msbuildArgs ;
353
+ }
354
+ else
343
355
{
356
+ // Apply defaults if the user didn't expressly set the verbosity.
357
+ // Setting RunCommandVerbosity to minimal ensures that we keep the previous launchsettings
358
+ // and related diagnostics messages on by default.
359
+ RunCommandVerbosity = VerbosityOptions . minimal ;
344
360
return msbuildArgs . CloneWithVerbosity ( VerbosityOptions . quiet ) ;
345
361
}
346
- return msbuildArgs ;
347
362
}
348
363
349
364
internal ICommand GetTargetCommand ( Func < ProjectCollection , ProjectInstance > ? projectFactory )
@@ -356,7 +371,7 @@ internal ICommand GetTargetCommand(Func<ProjectCollection, ProjectInstance>? pro
356
371
return CreateCommandForCscBuiltProgram ( EntryPointFileFullPath ) ;
357
372
}
358
373
359
- FacadeLogger ? logger = LoggerUtility . DetermineBinlogger ( [ ..MSBuildArgs . OtherMSBuildArgs ] , "dotnet-run" ) ;
374
+ FacadeLogger ? logger = LoggerUtility . DetermineBinlogger ( [ .. MSBuildArgs . OtherMSBuildArgs ] , "dotnet-run" ) ;
360
375
var project = EvaluateProject ( ProjectFileFullPath , projectFactory , MSBuildArgs , logger ) ;
361
376
ValidatePreconditions ( project ) ;
362
377
InvokeRunArgumentsTarget ( project , NoBuild , logger , MSBuildArgs ) ;
0 commit comments