1 write to InteractionService
aspire (1)
Commands\BaseCommand.cs (1)
26InteractionService = interactionService;
205 references to InteractionService
aspire (205)
Commands\AddCommand.cs (13)
95if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, _features, _hostEnvironment, cancellationToken)) 113var packagesWithChannels = await InteractionService.ShowStatusAsync( 162InteractionService.DisplayError(AddCommandStrings.NoPackagesFound); 199var success = await InteractionService.ShowStatusAsync( 208InteractionService.DisplayLines(outputCollector.GetLines()); 210InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.PackageInstallationFailed, ExitCodeConstants.FailedToAddPackage)); 214InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.PackageAddedSuccessfully, selectedNuGetPackage.Package.Id, selectedNuGetPackage.Package.Version)); 219return HandleProjectLocatorException(ex, InteractionService); 223InteractionService.DisplayCancellationMessage(); 228InteractionService.DisplayError(ex.Message); 235InteractionService.DisplayLines(outputCollector.GetLines()); 237InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.ErrorOccurredWhileAddingPackage, ex.Message)); 275InteractionService.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\ExtensionInternalCommand.cs (1)
57InteractionService.DisplayRawText(json);
Commands\InitCommand.cs (59)
154InteractionService.DisplayError($"Unknown language: {selectedProject.LanguageId}"); 158InteractionService.DisplayEmptyLine(); 159InteractionService.DisplayMessage("information", $"Creating {languageInfo.DisplayName} AppHost..."); 160InteractionService.DisplayEmptyLine(); 166if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, _features, _hostEnvironment, cancellationToken)) 179InteractionService.DisplayEmptyLine(); 180InteractionService.DisplayMessage("information", string.Format(CultureInfo.CurrentCulture, InitCommandStrings.SolutionDetected, initContext.SelectedSolutionFile.Name)); 181InteractionService.DisplayEmptyLine(); 186InteractionService.DisplayEmptyLine(); 187InteractionService.DisplayMessage("information", InitCommandStrings.NoSolutionFoundCreatingSingleFileAppHost); 188InteractionService.DisplayEmptyLine(); 198var (getSolutionExitCode, solutionProjects) = await InteractionService.ShowStatusAsync("Reading solution...", async () => 214InteractionService.DisplayLines(initContext.GetSolutionProjectsOutputCollector.GetLines()); 215InteractionService.DisplayError("Failed to get projects from solution."); 221_ = await InteractionService.ShowStatusAsync("Evaluating existing projects...", async () => 231InteractionService.DisplayMessage("check_mark", InitCommandStrings.SolutionAlreadyInitialized); 247InteractionService.DisplayEmptyLine(); 248InteractionService.DisplayMarkdown(addExecutableProjectsMessage); 249InteractionService.DisplayEmptyLine(); 251var selectedProjects = await InteractionService.PromptForSelectionsAsync( 262InteractionService.DisplayEmptyLine(); 263InteractionService.DisplayMessage("information", "The following projects will be added to the AppHost:"); 264InteractionService.DisplayEmptyLine(); 268InteractionService.DisplayMessage("check_box_with_check", project.ProjectFile.Name); 280InteractionService.DisplayEmptyLine(); 281InteractionService.DisplayMarkdown(addServiceDefaultsMessage); 282InteractionService.DisplayEmptyLine(); 291var selection = await InteractionService.PromptForSelectionAsync( 304initContext.ProjectsToAddServiceDefaultsTo = await InteractionService.PromptForSelectionsAsync( 322var nugetConfigPrompter = new NuGetConfigPrompter(InteractionService); 339var templateInstallResult = await InteractionService.ShowStatusAsync( 361InteractionService.DisplayLines(initContext.InstallTemplateOutputCollector.GetLines()); 362InteractionService.DisplayError("Failed to install Aspire templates."); 367var createResult = await InteractionService.ShowStatusAsync( 388InteractionService.DisplayLines(initContext.NewProjectOutputCollector.GetLines()); 389InteractionService.DisplayError($"Failed to create Aspire projects. Exit code: {createResult}"); 400InteractionService.DisplayError("Failed to find created AppHost or ServiceDefaults projects in template output."); 422var addAppHostResult = await InteractionService.ShowStatusAsync( 441InteractionService.DisplayLines(initContext.AddAppHostToSolutionOutputCollector.GetLines()); 442InteractionService.DisplayError($"Failed to add AppHost project to solution. Exit code: {addAppHostResult}"); 448var addServiceDefaultsResult = await InteractionService.ShowStatusAsync( 467InteractionService.DisplayLines(initContext.AddServiceDefaultsToSolutionOutputCollector.GetLines()); 468InteractionService.DisplayError($"Failed to add ServiceDefaults project to solution. Exit code: {addServiceDefaultsResult}"); 481var addRefResult = await InteractionService.ShowStatusAsync( 499InteractionService.DisplayLines(outputCollector.GetLines()); 500InteractionService.DisplayError($"Failed to add reference to {Path.GetFileNameWithoutExtension(project.ProjectFile.Name)}."); 515var addRefResult = await InteractionService.ShowStatusAsync( 533InteractionService.DisplayLines(outputCollector.GetLines()); 534InteractionService.DisplayError($"Failed to add ServiceDefaults reference to {Path.GetFileNameWithoutExtension(project.ProjectFile.Name)}."); 542InteractionService.DisplaySuccess(InitCommandStrings.AspireInitializationComplete); 566InteractionService.DisplayMessage("check_mark", $"{appHostFileName} already exists in this directory."); 575InteractionService.DisplaySuccess($"Created {appHostFileName}"); 576InteractionService.DisplayMessage("information", $"Run 'aspire run' to start your AppHost."); 586InteractionService.DisplayError("Single-file AppHost template not found."); 596InteractionService.DisplaySuccess(InitCommandStrings.AspireInitializationComplete); 720var packagesFromChannels = await InteractionService.ShowStatusAsync("Searching for available template versions...", async () => 770InteractionService.DisplayEmptyLine(); 771InteractionService.DisplayMarkdown(templateSelectionMessage); 772InteractionService.DisplayEmptyLine();
Commands\NewCommand.cs (7)
134var templateCommand = new TemplateCommand(template, ExecuteAsync, _features, _updateNotifier, _executionContext, InteractionService); 172InteractionService.DisplayError($"Unknown language: '{explicitLanguage}'"); 181if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, _features, _hostEnvironment, cancellationToken)) 188if (templateResult.OutputPath is not null && ExtensionHelper.IsExtensionHost(InteractionService, out var extensionInteractionService, out _)) 228InteractionService.DisplaySuccess($"Created {language.DisplayName} project at {outputPath}"); 229InteractionService.DisplayMessage("information", "Run 'aspire run' to start your AppHost."); 231if (ExtensionHelper.IsExtensionHost(InteractionService, out var extensionInteractionService, out _))
Commands\PipelineCommandBase.cs (29)
123if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, _features, _hostEnvironment, cancellationToken)) 186InteractionService.DisplayMessage("bug", InteractionServiceStrings.WaitingForDebuggerToAttachToAppHost); 189var backchannel = await InteractionService.ShowStatusAsync($":hammer_and_wrench: {GetProgressMessage(parseResult)}", async () => 228InteractionService.DisplayLines(outputCollector.GetLines()); 248InteractionService.DisplayError(GetCanceledMessage()); 256return HandleProjectLocatorException(ex, InteractionService); 263InteractionService.DisplayError(ex.Message); 271InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.ErrorConnectingToAppHost, ex.Message)); 274InteractionService.DisplayLines(outputCollector.GetLines()); 283InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.AppHostConnectionLost, ex.Message)); 286InteractionService.DisplayLines(outputCollector.GetLines()); 295InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.UnexpectedErrorOccurred, ex.Message)); 298InteractionService.DisplayLines(outputCollector.GetLines()); 335InteractionService.DisplaySubtleMessage($"[[DEBUG]] Step {stepCounter++}: {statusText}", escapeMarkup: false); 344InteractionService.DisplaySubtleMessage($"[[DEBUG]] Step {activity.Data.Id}: {status} - {statusText}", escapeMarkup: false); 379InteractionService.DisplaySubtleMessage(formattedMessage, escapeMarkup: false); 390InteractionService.DisplaySubtleMessage($"[[DEBUG]] Task {activity.Data.Id} ({stepId}): {status} - {statusText}", escapeMarkup: false); 394InteractionService.DisplaySubtleMessage($"[[DEBUG]] {completionMessage}", escapeMarkup: false); 400InteractionService.DisplaySubtleMessage($"[[DEBUG]] Task {activity.Data.Id} ({stepId}): {statusText}", escapeMarkup: false); 412InteractionService.DisplaySubtleMessage($"[[DEBUG]] {OperationCompletedPrefix}: {status} - {statusText}", escapeMarkup: false); 749InteractionService.DisplayError(error); 755InputType.Text => await InteractionService.PromptForStringAsync( 761InputType.SecretText => await InteractionService.PromptForStringAsync( 770InputType.Boolean => (await InteractionService.ConfirmAsync(promptText, defaultValue: ParseBooleanValue(input.Value), cancellationToken: cancellationToken)).ToString().ToLowerInvariant(), 774_ => await InteractionService.PromptForStringAsync(promptText, defaultValue: input.Value?.EscapeMarkup(), required: input.Required, cancellationToken: cancellationToken) 782return await InteractionService.PromptForStringAsync(promptText, defaultValue: input.Value?.EscapeMarkup(), required: input.Required, cancellationToken: cancellationToken); 796var (value, displayText) = await InteractionService.PromptForSelectionAsync( 804return await InteractionService.PromptForStringAsync(promptText, defaultValue: input.Value?.EscapeMarkup(), required: input.Required, cancellationToken: cancellationToken); 824return await InteractionService.PromptForStringAsync(
Commands\RunCommand.cs (19)
90if (ExtensionHelper.IsExtensionHost(InteractionService, out _, out _)) 103var isExtensionHost = ExtensionHelper.IsExtensionHost(InteractionService, out _, out _); 111if (ExtensionHelper.IsExtensionHost(InteractionService, out var extensionInteractionService, out _) 120if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, _features, _hostEnvironment, cancellationToken)) 143InteractionService.DisplayError("Unrecognized app host type."); 185InteractionService.DisplayLines(outputCollector.GetLines()); 187InteractionService.DisplayError(InteractionServiceStrings.ProjectCouldNotBeBuilt); 192var backchannel = await InteractionService.ShowStatusAsync( 201var dashboardUrls = await InteractionService.ShowStatusAsync( 207InteractionService.DisplayError(RunCommandStrings.DashboardFailedToStart); 299if (ExtensionHelper.IsExtensionHost(InteractionService, out var extInteractionService, out _)) 310InteractionService.DisplayCancellationMessage(); 315return HandleProjectLocatorException(ex, InteractionService); 319return InteractionService.DisplayIncompatibleVersionError(ex, ex.RequiredCapability); 323InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, TemplatingStrings.CertificateTrustError, ex.Message.EscapeMarkup())); 328InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.ErrorConnectingToAppHost, ex.Message.EscapeMarkup())); 331InteractionService.DisplayLines(outputCollector.GetLines()); 337InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.UnexpectedErrorOccurred, ex.Message.EscapeMarkup())); 340InteractionService.DisplayLines(outputCollector.GetLines());
Commands\UpdateCommand.cs (22)
120InteractionService.DisplayMessage("information", UpdateCommandStrings.DotNetToolSelfUpdateMessage); 121InteractionService.DisplayPlainText(" dotnet tool update -g Aspire.Cli"); 127InteractionService.DisplayError("CLI self-update is not available in this environment."); 137InteractionService.DisplayCancellationMessage(); 173channel = await InteractionService.PromptForSelectionAsync( 202var shouldUpdateCli = await InteractionService.ConfirmAsync( 217InteractionService.DisplayError(message); 223InteractionService.DisplayError(message); 234var shouldUpdateCli = await InteractionService.ConfirmAsync( 246return HandleProjectLocatorException(ex, InteractionService); 250InteractionService.DisplayCancellationMessage(); 267channel = await InteractionService.PromptForSelectionAsync( 280InteractionService.DisplayError("Unable to determine the current executable path."); 284InteractionService.DisplayMessage("package", $"Current CLI location: {currentExePath}"); 285InteractionService.DisplayMessage("up_arrow", $"Updating to channel: {channel}"); 311InteractionService.DisplayCancellationMessage(); 317InteractionService.DisplayError($"Failed to update CLI: {ex.Message}"); 344InteractionService.DisplayMessage("package", "Extracting new CLI..."); 359InteractionService.DisplayMessage("floppy_disk", "Backing up current CLI..."); 372InteractionService.DisplayMessage("wrench", $"Installing new CLI to {installDir}..."); 395InteractionService.DisplayMessage("information", $"Note: {installDir} is not in your PATH. Add it to use the updated CLI globally."); 504InteractionService.DisplaySuccess($"Updated to version: {version}");