1 write to InteractionService
aspire (1)
Commands\BaseCommand.cs (1)
26InteractionService = interactionService;
201 references to InteractionService
aspire (201)
Commands\AddCommand.cs (13)
73if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, _features, _hostEnvironment, cancellationToken)) 96var packagesWithChannels = await InteractionService.ShowStatusAsync( 139InteractionService.DisplayError(AddCommandStrings.NoPackagesFound); 167var addPackageResult = await InteractionService.ShowStatusAsync( 190InteractionService.DisplayLines(outputCollector.GetLines()); 191InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.PackageInstallationFailed, addPackageResult)); 196InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.PackageAddedSuccessfully, selectedNuGetPackage.Package.Id, selectedNuGetPackage.Package.Version)); 202return HandleProjectLocatorException(ex, InteractionService); 206InteractionService.DisplayCancellationMessage(); 211InteractionService.DisplayError(ex.Message); 216InteractionService.DisplayLines(outputCollector.GetLines()); 217InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.ErrorOccurredWhileAddingPackage, ex.Message)); 255InteractionService.DisplaySubtleMessage(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.NoPackagesMatchedSearchTerm, searchTerm));
Commands\BaseCommand.cs (1)
48InteractionService.DisplayEmptyLine();
Commands\CacheCommand.cs (4)
21var clearCommand = new ClearCommand(InteractionService, features, updateNotifier, executionContext); 114InteractionService.DisplayMessage("information", CacheCommandStrings.CacheAlreadyEmpty); 118InteractionService.DisplaySuccess(CacheCommandStrings.CacheCleared); 125InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, CacheCommandStrings.CacheClearFailed, ex.Message));
Commands\ConfigCommand.cs (26)
34var getCommand = new GetCommand(configurationService, InteractionService, features, updateNotifier, executionContext); 35var setCommand = new SetCommand(configurationService, InteractionService, features, updateNotifier, executionContext); 36var listCommand = new ListCommand(configurationService, InteractionService, features, updateNotifier, executionContext); 37var deleteCommand = new DeleteCommand(configurationService, InteractionService, features, updateNotifier, executionContext); 88InteractionService.DisplayError(ErrorStrings.ConfigurationKeyRequired); 97var key = await InteractionService.PromptForStringAsync(ConfigCommandStrings.GetCommand_PromptForKey, required: true, cancellationToken: cancellationToken); 107InteractionService.DisplayPlainText(value); 112InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ConfigurationKeyNotFound, key)); 152InteractionService.DisplayError(ErrorStrings.ConfigurationKeyRequired); 158InteractionService.DisplayError(ErrorStrings.ConfigurationValueRequired); 167var key = await InteractionService.PromptForStringAsync(ConfigCommandStrings.SetCommand_PromptForKey, required: true, cancellationToken: cancellationToken); 168var value = await InteractionService.PromptForStringAsync(ConfigCommandStrings.SetCommand_PromptForValue, required: true, cancellationToken: cancellationToken); 169var isGlobal = await InteractionService.PromptForSelectionAsync( 183InteractionService.DisplaySuccess(isGlobal 193InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ErrorSettingConfiguration, ex.Message)); 211if (InteractionService is ExtensionInteractionService extensionInteractionService) 225InteractionService.DisplayMessage("information", ConfigCommandStrings.NoConfigurationValuesFound); 229InteractionService.DisplayLines(allConfig.Select(kvp => ("stdout", $"{kvp.Key}={kvp.Value}"))); 262InteractionService.DisplayError(ErrorStrings.ConfigurationKeyRequired); 271var key = await InteractionService.PromptForStringAsync(ConfigCommandStrings.DeleteCommand_PromptForKey, required: true, cancellationToken: cancellationToken); 276InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ConfigurationKeyNotFound, key)); 280var isGlobal = await InteractionService.PromptForSelectionAsync( 299InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, ConfigCommandStrings.ConfigurationKeyDeletedGlobally, key)); 303InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, ConfigCommandStrings.ConfigurationKeyDeletedLocally, key)); 310InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ConfigurationKeyNotFound, key)); 316InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ErrorDeletingConfiguration, ex.Message));
Commands\DoctorCommand.cs (1)
45var results = await InteractionService.ShowStatusAsync(
Commands\ExecCommand.cs (23)
90if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, _features, _hostEnvironment, cancellationToken)) 106InteractionService.DisplayError(ExecCommandStrings.TargetResourceNotSpecified); 114InteractionService.DisplayError(ExecCommandStrings.NoCommandSpecified); 122InteractionService.DisplayError(ExecCommandStrings.FailedToParseCommand); 148InteractionService.DisplayError(ErrorStrings.CommandNotSupportedWithSingleFileAppHost); 160appHostCompatibilityCheck = await AppHostHelper.CheckAppHostCompatibilityAsync(_runner, InteractionService, effectiveAppHostProjectFile, _telemetry, ExecutionContext.WorkingDirectory, cancellationToken); 198backchannel = await InteractionService.ShowStatusAsync( 206InteractionService.DisplayMessage(emoji: "bug", InteractionServiceStrings.WaitingForDebuggerToAttachToAppHost); 216commandExitCode = await InteractionService.ShowStatusAsync<int?>( 225InteractionService.WriteConsoleLog(output.Text, output.LineNumber, output.Type, output.IsErrorMessage); 239_ = await InteractionService.ShowStatusAsync<int>( 260InteractionService.DisplayLines(runOutputCollector.GetLines()); 261InteractionService.DisplayError(RunCommandStrings.ProjectCouldNotBeRun); 271InteractionService.DisplayLines(runOutputCollector.GetLines()); 272InteractionService.DisplayError(RunCommandStrings.ProjectCouldNotBeRun); 278InteractionService.DisplayCancellationMessage(); 283return HandleProjectLocatorException(ex, InteractionService); 287return InteractionService.DisplayIncompatibleVersionError( 294InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, TemplatingStrings.CertificateTrustError, ex.Message)); 299InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.ErrorConnectingToAppHost, ex.Message)); 300InteractionService.DisplayLines(runOutputCollector.GetLines()); 305InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.UnexpectedErrorOccurred, ex.Message)); 306InteractionService.DisplayLines(runOutputCollector.GetLines());
Commands\InitCommand.cs (52)
117if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, _features, _hostEnvironment, cancellationToken)) 132InteractionService.DisplayEmptyLine(); 133InteractionService.DisplayMessage("information", string.Format(CultureInfo.CurrentCulture, InitCommandStrings.SolutionDetected, initContext.SelectedSolutionFile.Name)); 134InteractionService.DisplayEmptyLine(); 139InteractionService.DisplayEmptyLine(); 140InteractionService.DisplayMessage("information", InitCommandStrings.NoSolutionFoundCreatingSingleFileAppHost); 141InteractionService.DisplayEmptyLine(); 151var (getSolutionExitCode, solutionProjects) = await InteractionService.ShowStatusAsync("Reading solution...", async () => 167InteractionService.DisplayLines(initContext.GetSolutionProjectsOutputCollector.GetLines()); 168InteractionService.DisplayError("Failed to get projects from solution."); 174_ = await InteractionService.ShowStatusAsync("Evaluating existing projects...", async () => 184InteractionService.DisplayMessage("check_mark", InitCommandStrings.SolutionAlreadyInitialized); 200InteractionService.DisplayEmptyLine(); 201InteractionService.DisplayMarkdown(addExecutableProjectsMessage); 202InteractionService.DisplayEmptyLine(); 204var selectedProjects = await InteractionService.PromptForSelectionsAsync( 215InteractionService.DisplayEmptyLine(); 216InteractionService.DisplayMessage("information", "The following projects will be added to the AppHost:"); 217InteractionService.DisplayEmptyLine(); 221InteractionService.DisplayMessage("check_box_with_check", project.ProjectFile.Name); 233InteractionService.DisplayEmptyLine(); 234InteractionService.DisplayMarkdown(addServiceDefaultsMessage); 235InteractionService.DisplayEmptyLine(); 244var selection = await InteractionService.PromptForSelectionAsync( 257initContext.ProjectsToAddServiceDefaultsTo = await InteractionService.PromptForSelectionsAsync( 275var nugetConfigPrompter = new NuGetConfigPrompter(InteractionService); 292var templateInstallResult = await InteractionService.ShowStatusAsync( 314InteractionService.DisplayLines(initContext.InstallTemplateOutputCollector.GetLines()); 315InteractionService.DisplayError("Failed to install Aspire templates."); 320var createResult = await InteractionService.ShowStatusAsync( 341InteractionService.DisplayLines(initContext.NewProjectOutputCollector.GetLines()); 342InteractionService.DisplayError($"Failed to create Aspire projects. Exit code: {createResult}"); 353InteractionService.DisplayError("Failed to find created AppHost or ServiceDefaults projects in template output."); 375var addAppHostResult = await InteractionService.ShowStatusAsync( 394InteractionService.DisplayLines(initContext.AddAppHostToSolutionOutputCollector.GetLines()); 395InteractionService.DisplayError($"Failed to add AppHost project to solution. Exit code: {addAppHostResult}"); 401var addServiceDefaultsResult = await InteractionService.ShowStatusAsync( 420InteractionService.DisplayLines(initContext.AddServiceDefaultsToSolutionOutputCollector.GetLines()); 421InteractionService.DisplayError($"Failed to add ServiceDefaults project to solution. Exit code: {addServiceDefaultsResult}"); 434var addRefResult = await InteractionService.ShowStatusAsync( 452InteractionService.DisplayLines(outputCollector.GetLines()); 453InteractionService.DisplayError($"Failed to add reference to {Path.GetFileNameWithoutExtension(project.ProjectFile.Name)}."); 468var addRefResult = await InteractionService.ShowStatusAsync( 486InteractionService.DisplayLines(outputCollector.GetLines()); 487InteractionService.DisplayError($"Failed to add ServiceDefaults reference to {Path.GetFileNameWithoutExtension(project.ProjectFile.Name)}."); 495InteractionService.DisplaySuccess(InitCommandStrings.AspireInitializationComplete); 514InteractionService.DisplayError("Single-file AppHost template not found."); 524InteractionService.DisplaySuccess(InitCommandStrings.AspireInitializationComplete); 648var packagesFromChannels = await InteractionService.ShowStatusAsync("Searching for available template versions...", async () => 698InteractionService.DisplayEmptyLine(); 699InteractionService.DisplayMarkdown(templateSelectionMessage); 700InteractionService.DisplayEmptyLine();
Commands\NewCommand.cs (3)
115var templateCommand = new TemplateCommand(template, ExecuteAsync, _features, _updateNotifier, _executionContext, InteractionService); 139if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, _features, _hostEnvironment, cancellationToken)) 148if (templateResult.OutputPath is not null && ExtensionHelper.IsExtensionHost(InteractionService, out var extensionInteractionService, out _))
Commands\PipelineCommandBase.cs (33)
112if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, _features, _hostEnvironment, cancellationToken)) 161appHostCompatibilityCheck = await AppHostHelper.CheckAppHostCompatibilityAsync(_runner, InteractionService, effectiveAppHostFile, _telemetry, ExecutionContext.WorkingDirectory, cancellationToken); 179var buildExitCode = await AppHostHelper.BuildAppHostAsync(_runner, InteractionService, effectiveAppHostFile, buildOptions, ExecutionContext.WorkingDirectory, cancellationToken); 185InteractionService.DisplayLines(buildOutputCollector.GetLines()); 186InteractionService.DisplayError(InteractionServiceStrings.ProjectCouldNotBeBuilt); 220InteractionService.DisplayMessage("bug", InteractionServiceStrings.WaitingForDebuggerToAttachToAppHost); 223var backchannel = await InteractionService.ShowStatusAsync($":hammer_and_wrench: {GetProgressMessage(parseResult)}", async () => 253InteractionService.DisplayLines(operationOutputCollector.GetLines()); 264InteractionService.DisplayLines(operationOutputCollector.GetLines()); 276InteractionService.DisplayError(GetCanceledMessage()); 283return HandleProjectLocatorException(ex, InteractionService); 289return InteractionService.DisplayIncompatibleVersionError( 298InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.ErrorConnectingToAppHost, ex.Message)); 299InteractionService.DisplayLines(operationOutputCollector.GetLines()); 306InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.AppHostConnectionLost, ex.Message)); 307InteractionService.DisplayLines(operationOutputCollector.GetLines()); 314InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.UnexpectedErrorOccurred, ex.Message)); 350InteractionService.DisplaySubtleMessage($"[[DEBUG]] Step {stepCounter++}: {statusText}", escapeMarkup: false); 359InteractionService.DisplaySubtleMessage($"[[DEBUG]] Step {activity.Data.Id}: {status} - {statusText}", escapeMarkup: false); 394InteractionService.DisplaySubtleMessage(formattedMessage, escapeMarkup: false); 405InteractionService.DisplaySubtleMessage($"[[DEBUG]] Task {activity.Data.Id} ({stepId}): {status} - {statusText}", escapeMarkup: false); 409InteractionService.DisplaySubtleMessage($"[[DEBUG]] {completionMessage}", escapeMarkup: false); 415InteractionService.DisplaySubtleMessage($"[[DEBUG]] Task {activity.Data.Id} ({stepId}): {statusText}", escapeMarkup: false); 427InteractionService.DisplaySubtleMessage($"[[DEBUG]] {OperationCompletedPrefix}: {status} - {statusText}", escapeMarkup: false); 764InteractionService.DisplayError(error); 770InputType.Text => await InteractionService.PromptForStringAsync( 776InputType.SecretText => await InteractionService.PromptForStringAsync( 785InputType.Boolean => (await InteractionService.ConfirmAsync(promptText, defaultValue: ParseBooleanValue(input.Value), cancellationToken: cancellationToken)).ToString().ToLowerInvariant(), 789_ => await InteractionService.PromptForStringAsync(promptText, defaultValue: input.Value?.EscapeMarkup(), required: input.Required, cancellationToken: cancellationToken) 797return await InteractionService.PromptForStringAsync(promptText, defaultValue: input.Value?.EscapeMarkup(), required: input.Required, cancellationToken: cancellationToken); 811var (value, displayText) = await InteractionService.PromptForSelectionAsync( 819return await InteractionService.PromptForStringAsync(promptText, defaultValue: input.Value?.EscapeMarkup(), required: input.Required, cancellationToken: cancellationToken); 839return await InteractionService.PromptForStringAsync(
Commands\RunCommand.cs (23)
91if (ExtensionHelper.IsExtensionHost(InteractionService, out _, out _)) 104var isExtensionHost = ExtensionHelper.IsExtensionHost(InteractionService, out _, out _); 112if (ExtensionHelper.IsExtensionHost(InteractionService, out var extensionInteractionService, out _) 121if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, _features, _hostEnvironment, cancellationToken)) 177var buildExitCode = await AppHostHelper.BuildAppHostAsync(_runner, InteractionService, effectiveAppHostFile, buildOptions, ExecutionContext.WorkingDirectory, cancellationToken); 181InteractionService.DisplayLines(buildOutputCollector.GetLines()); 182InteractionService.DisplayError(InteractionServiceStrings.ProjectCouldNotBeBuilt); 195appHostCompatibilityCheck = await AppHostHelper.CheckAppHostCompatibilityAsync(_runner, InteractionService, effectiveAppHostFile, _telemetry, ExecutionContext.WorkingDirectory, cancellationToken); 245var backchannel = await InteractionService.ShowStatusAsync(isExtensionHost ? InteractionServiceStrings.BuildingAppHost : RunCommandStrings.ConnectingToAppHost, async () => { return await backchannelCompletitionSource.Task.WaitAsync(cancellationToken); }); 251var dashboardUrls = await InteractionService.ShowStatusAsync(RunCommandStrings.StartingDashboard, async () => { return await backchannel.GetDashboardUrlsAsync(cancellationToken); }); 255InteractionService.DisplayError(RunCommandStrings.DashboardFailedToStart); 256InteractionService.DisplayLines(runOutputCollector.GetLines()); 354if (ExtensionHelper.IsExtensionHost(InteractionService, out extensionInteractionService, out _)) 365InteractionService.DisplayCancellationMessage(); 370return HandleProjectLocatorException(ex, InteractionService); 374return InteractionService.DisplayIncompatibleVersionError( 381InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, TemplatingStrings.CertificateTrustError, ex.Message.EscapeMarkup())); 386InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.ErrorConnectingToAppHost, ex.Message.EscapeMarkup())); 387InteractionService.DisplayLines(runOutputCollector.GetLines()); 392InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.UnexpectedErrorOccurred, ex.Message.EscapeMarkup())); 393InteractionService.DisplayLines(runOutputCollector.GetLines()); 552InteractionService.DisplayMessage("stop_sign", $"Stopping previous instance (AppHost PID: {appHostInfo.ProcessId.ToString(CultureInfo.InvariantCulture)}, CLI PID: {cliPidText})"); 562InteractionService.DisplaySuccess(RunCommandStrings.RunningInstanceStopped);
Commands\UpdateCommand.cs (22)
119InteractionService.DisplayMessage("information", UpdateCommandStrings.DotNetToolSelfUpdateMessage); 120InteractionService.DisplayPlainText(" dotnet tool update -g Aspire.Cli"); 126InteractionService.DisplayError("CLI self-update is not available in this environment."); 136InteractionService.DisplayCancellationMessage(); 172channel = await InteractionService.PromptForSelectionAsync( 194var shouldUpdateCli = await InteractionService.ConfirmAsync( 209InteractionService.DisplayError(message); 215InteractionService.DisplayError(message); 226var shouldUpdateCli = await InteractionService.ConfirmAsync( 238return HandleProjectLocatorException(ex, InteractionService); 242InteractionService.DisplayCancellationMessage(); 259channel = await InteractionService.PromptForSelectionAsync( 272InteractionService.DisplayError("Unable to determine the current executable path."); 276InteractionService.DisplayMessage("package", $"Current CLI location: {currentExePath}"); 277InteractionService.DisplayMessage("up_arrow", $"Updating to channel: {channel}"); 293InteractionService.DisplayCancellationMessage(); 299InteractionService.DisplayError($"Failed to update CLI: {ex.Message}"); 324InteractionService.DisplayMessage("package", "Extracting new CLI..."); 339InteractionService.DisplayMessage("floppy_disk", "Backing up current CLI..."); 352InteractionService.DisplayMessage("wrench", $"Installing new CLI to {installDir}..."); 375InteractionService.DisplayMessage("information", $"Note: {installDir} is not in your PATH. Add it to use the updated CLI globally."); 479InteractionService.DisplaySuccess($"Updated to version: {version}");