@@ -142,25 +142,25 @@ public int Execute()
142142 return 1 ;
143143 }
144144
145- var launchProfileSettings = ReadLaunchProfileSettings ( ) ;
146- if ( launchProfileSettings . FailureReason != null )
145+ var launchProfileParseResult = ReadLaunchProfileSettings ( ) ;
146+ if ( launchProfileParseResult . FailureReason != null )
147147 {
148- Reporter . Error . WriteLine ( string . Format ( CliCommandStrings . RunCommandExceptionCouldNotApplyLaunchSettings , LaunchProfileParser . GetLaunchProfileDisplayName ( LaunchProfile ) , launchProfileSettings . FailureReason ) . Bold ( ) . Red ( ) ) ;
148+ Reporter . Error . WriteLine ( string . Format ( CliCommandStrings . RunCommandExceptionCouldNotApplyLaunchSettings , LaunchProfileParser . GetLaunchProfileDisplayName ( LaunchProfile ) , launchProfileParseResult . FailureReason ) . Bold ( ) . Red ( ) ) ;
149149 }
150150
151151 Func < ProjectCollection , ProjectInstance > ? projectFactory = null ;
152152 RunProperties ? cachedRunProperties = null ;
153153 VirtualProjectBuildingCommand ? projectBuilder = null ;
154154 if ( ShouldBuild )
155155 {
156- if ( launchProfileSettings . Model ? . DotNetRunMessages == true )
156+ if ( launchProfileParseResult . Profile ? . DotNetRunMessages == true )
157157 {
158158 Reporter . Output . WriteLine ( CliCommandStrings . RunCommandBuilding ) ;
159159 }
160160
161161 EnsureProjectIsBuilt ( out projectFactory , out cachedRunProperties , out projectBuilder ) ;
162162 }
163- else if ( EntryPointFileFullPath is not null && launchProfileSettings . Model is not ExecutableLaunchSettings )
163+ else if ( EntryPointFileFullPath is not null && launchProfileParseResult . Profile is not ExecutableLaunchProfile )
164164 {
165165 // The entry-point is not used to run the application if the launch profile specifies Executable command.
166166
@@ -173,23 +173,23 @@ public int Execute()
173173 cachedRunProperties = cacheEntry ? . Run ;
174174 }
175175
176- var targetCommand = GetTargetCommand ( launchProfileSettings . Model , projectFactory , cachedRunProperties ) ;
176+ var targetCommand = GetTargetCommand ( launchProfileParseResult . Profile , projectFactory , cachedRunProperties ) ;
177177
178178 // Send telemetry about the run operation
179- SendRunTelemetry ( launchProfileSettings . Model , projectBuilder ) ;
179+ SendRunTelemetry ( launchProfileParseResult . Profile , projectBuilder ) ;
180180
181181 // Ignore Ctrl-C for the remainder of the command's execution
182182 Console . CancelKeyPress += ( sender , e ) => { e . Cancel = true ; } ;
183183
184184 return targetCommand . Execute ( ) . ExitCode ;
185185 }
186186
187- internal ICommand GetTargetCommand ( LaunchSettings ? launchSettings , Func < ProjectCollection , ProjectInstance > ? projectFactory , RunProperties ? cachedRunProperties )
187+ internal ICommand GetTargetCommand ( LaunchProfile ? launchSettings , Func < ProjectCollection , ProjectInstance > ? projectFactory , RunProperties ? cachedRunProperties )
188188 => launchSettings switch
189189 {
190190 null => GetTargetCommandForProject ( launchSettings : null , projectFactory , cachedRunProperties ) ,
191- ProjectLaunchSettings projectSettings => GetTargetCommandForProject ( projectSettings , projectFactory , cachedRunProperties ) ,
192- ExecutableLaunchSettings executableSettings => GetTargetCommandForExecutable ( executableSettings ) ,
191+ ProjectLaunchProfile projectSettings => GetTargetCommandForProject ( projectSettings , projectFactory , cachedRunProperties ) ,
192+ ExecutableLaunchProfile executableSettings => GetTargetCommandForExecutable ( executableSettings ) ,
193193 _ => throw new InvalidOperationException ( )
194194 } ;
195195
@@ -287,7 +287,7 @@ private void ApplySelectedFramework(string? selectedFramework)
287287 }
288288 }
289289
290- private ICommand GetTargetCommandForExecutable ( ExecutableLaunchSettings launchSettings )
290+ private ICommand GetTargetCommandForExecutable ( ExecutableLaunchProfile launchSettings )
291291 {
292292 var workingDirectory = launchSettings . WorkingDirectory ?? Path . GetDirectoryName ( ProjectOrEntryPointPath ) ;
293293
@@ -304,10 +304,10 @@ private ICommand GetTargetCommandForExecutable(ExecutableLaunchSettings launchSe
304304 return command ;
305305 }
306306
307- private void SetEnvironmentVariables ( ICommand command , LaunchSettings ? launchSettings )
307+ private void SetEnvironmentVariables ( ICommand command , LaunchProfile ? launchSettings )
308308 {
309309 // Handle Project-specific settings
310- if ( launchSettings is ProjectLaunchSettings projectSettings )
310+ if ( launchSettings is ProjectLaunchProfile projectSettings )
311311 {
312312 if ( ! string . IsNullOrEmpty ( projectSettings . ApplicationUrl ) )
313313 {
@@ -332,31 +332,31 @@ private void SetEnvironmentVariables(ICommand command, LaunchSettings? launchSet
332332 }
333333 }
334334
335- internal LaunchProfileSettings ReadLaunchProfileSettings ( )
335+ internal LaunchProfileParseResult ReadLaunchProfileSettings ( )
336336 {
337337 if ( NoLaunchProfile )
338338 {
339- return LaunchProfileSettings . Success ( model : null ) ;
339+ return LaunchProfileParseResult . Success ( model : null ) ;
340340 }
341341
342342 var launchSettingsPath = ReadCodeFromStdin
343343 ? null
344- : LaunchSettingsLocator . TryFindLaunchSettings (
344+ : LaunchSettings . TryFindLaunchSettingsFile (
345345 projectOrEntryPointFilePath : ProjectFileFullPath ?? EntryPointFileFullPath ! ,
346346 launchProfile : LaunchProfile ,
347347 static ( message , isError ) => ( isError ? Reporter . Error : Reporter . Output ) . WriteLine ( message ) ) ;
348348
349349 if ( launchSettingsPath is null )
350350 {
351- return LaunchProfileSettings . Success ( model : null ) ;
351+ return LaunchProfileParseResult . Success ( model : null ) ;
352352 }
353353
354354 if ( ! RunCommandVerbosity . IsQuiet ( ) )
355355 {
356356 Reporter . Output . WriteLine ( string . Format ( CliCommandStrings . UsingLaunchSettingsFromMessage , launchSettingsPath ) ) ;
357357 }
358358
359- return LaunchSettingsManager . ReadProfileSettingsFromFile ( launchSettingsPath , LaunchProfile ) ;
359+ return LaunchSettings . ReadProfileSettingsFromFile ( launchSettingsPath , LaunchProfile ) ;
360360 }
361361
362362 private void EnsureProjectIsBuilt ( out Func < ProjectCollection , ProjectInstance > ? projectFactory , out RunProperties ? cachedRunProperties , out VirtualProjectBuildingCommand ? projectBuilder )
@@ -438,7 +438,7 @@ private MSBuildArgs SetupSilentBuildArgs(MSBuildArgs msbuildArgs)
438438 }
439439 }
440440
441- private ICommand GetTargetCommandForProject ( ProjectLaunchSettings ? launchSettings , Func < ProjectCollection , ProjectInstance > ? projectFactory , RunProperties ? cachedRunProperties )
441+ private ICommand GetTargetCommandForProject ( ProjectLaunchProfile ? launchSettings , Func < ProjectCollection , ProjectInstance > ? projectFactory , RunProperties ? cachedRunProperties )
442442 {
443443 ICommand command ;
444444 if ( cachedRunProperties != null )
@@ -844,7 +844,7 @@ public static ParseResult ModifyParseResultForShorthandProjectOption(ParseResult
844844 /// Sends telemetry about the run operation.
845845 /// </summary>
846846 private void SendRunTelemetry (
847- LaunchSettings ? launchSettings ,
847+ LaunchProfile ? launchSettings ,
848848 VirtualProjectBuildingCommand ? projectBuilder )
849849 {
850850 try
@@ -872,7 +872,7 @@ private void SendRunTelemetry(
872872 /// Builds and sends telemetry data for file-based app runs.
873873 /// </summary>
874874 private void SendFileBasedTelemetry (
875- LaunchSettings ? launchSettings ,
875+ LaunchProfile ? launchSettings ,
876876 VirtualProjectBuildingCommand projectBuilder )
877877 {
878878 Debug . Assert ( EntryPointFileFullPath != null ) ;
@@ -901,7 +901,7 @@ private void SendFileBasedTelemetry(
901901 /// <summary>
902902 /// Builds and sends telemetry data for project-based app runs.
903903 /// </summary>
904- private void SendProjectBasedTelemetry ( LaunchSettings ? launchSettings )
904+ private void SendProjectBasedTelemetry ( LaunchProfile ? launchSettings )
905905 {
906906 Debug . Assert ( ProjectFileFullPath != null ) ;
907907 var projectIdentifier = RunTelemetry . GetProjectBasedIdentifier ( ProjectFileFullPath , GetRepositoryRoot ( ) , Sha256Hasher . Hash ) ;
0 commit comments