1 write to InteractionService
aspire (1)
Commands\BaseCommand.cs (1)
26InteractionService = interactionService;
189 references to InteractionService
aspire (189)
Commands\AddCommand.cs (13)
73if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, _features, _hostEnvironment, cancellationToken)) 96var packagesWithChannels = await InteractionService.ShowStatusAsync( 132InteractionService.DisplayError(AddCommandStrings.NoPackagesFound); 160var addPackageResult = await InteractionService.ShowStatusAsync( 183InteractionService.DisplayLines(outputCollector.GetLines()); 184InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.PackageInstallationFailed, addPackageResult)); 189InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.PackageAddedSuccessfully, selectedNuGetPackage.Package.Id, selectedNuGetPackage.Package.Version)); 195return HandleProjectLocatorException(ex, InteractionService); 199InteractionService.DisplayCancellationMessage(); 204InteractionService.DisplayError(ex.Message); 209InteractionService.DisplayLines(outputCollector.GetLines()); 210InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.ErrorOccurredWhileAddingPackage, ex.Message)); 248InteractionService.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\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)
100if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, _features, _hostEnvironment, cancellationToken)) 115InteractionService.DisplayEmptyLine(); 116InteractionService.DisplayMessage("information", string.Format(CultureInfo.CurrentCulture, InitCommandStrings.SolutionDetected, initContext.SelectedSolutionFile.Name)); 117InteractionService.DisplayEmptyLine(); 122InteractionService.DisplayEmptyLine(); 123InteractionService.DisplayMessage("information", InitCommandStrings.NoSolutionFoundCreatingSingleFileAppHost); 124InteractionService.DisplayEmptyLine(); 134var (getSolutionExitCode, solutionProjects) = await InteractionService.ShowStatusAsync("Reading solution...", async () => 150InteractionService.DisplayLines(initContext.GetSolutionProjectsOutputCollector.GetLines()); 151InteractionService.DisplayError("Failed to get projects from solution."); 157_ = await InteractionService.ShowStatusAsync("Evaluating existing projects...", async () => 167InteractionService.DisplayMessage("check_mark", InitCommandStrings.SolutionAlreadyInitialized); 183InteractionService.DisplayEmptyLine(); 184InteractionService.DisplayMarkdown(addExecutableProjectsMessage); 185InteractionService.DisplayEmptyLine(); 187var selectedProjects = await InteractionService.PromptForSelectionsAsync( 198InteractionService.DisplayEmptyLine(); 199InteractionService.DisplayMessage("information", "The following projects will be added to the AppHost:"); 200InteractionService.DisplayEmptyLine(); 204InteractionService.DisplayMessage("check_box_with_check", project.ProjectFile.Name); 216InteractionService.DisplayEmptyLine(); 217InteractionService.DisplayMarkdown(addServiceDefaultsMessage); 218InteractionService.DisplayEmptyLine(); 227var selection = await InteractionService.PromptForSelectionAsync( 240initContext.ProjectsToAddServiceDefaultsTo = await InteractionService.PromptForSelectionsAsync( 258var nugetConfigPrompter = new NuGetConfigPrompter(InteractionService); 275var templateInstallResult = await InteractionService.ShowStatusAsync( 297InteractionService.DisplayLines(initContext.InstallTemplateOutputCollector.GetLines()); 298InteractionService.DisplayError("Failed to install Aspire templates."); 303var createResult = await InteractionService.ShowStatusAsync( 324InteractionService.DisplayLines(initContext.NewProjectOutputCollector.GetLines()); 325InteractionService.DisplayError($"Failed to create Aspire projects. Exit code: {createResult}"); 336InteractionService.DisplayError("Failed to find created AppHost or ServiceDefaults projects in template output."); 358var addAppHostResult = await InteractionService.ShowStatusAsync( 377InteractionService.DisplayLines(initContext.AddAppHostToSolutionOutputCollector.GetLines()); 378InteractionService.DisplayError($"Failed to add AppHost project to solution. Exit code: {addAppHostResult}"); 384var addServiceDefaultsResult = await InteractionService.ShowStatusAsync( 403InteractionService.DisplayLines(initContext.AddServiceDefaultsToSolutionOutputCollector.GetLines()); 404InteractionService.DisplayError($"Failed to add ServiceDefaults project to solution. Exit code: {addServiceDefaultsResult}"); 417var addRefResult = await InteractionService.ShowStatusAsync( 435InteractionService.DisplayLines(outputCollector.GetLines()); 436InteractionService.DisplayError($"Failed to add reference to {Path.GetFileNameWithoutExtension(project.ProjectFile.Name)}."); 451var addRefResult = await InteractionService.ShowStatusAsync( 469InteractionService.DisplayLines(outputCollector.GetLines()); 470InteractionService.DisplayError($"Failed to add ServiceDefaults reference to {Path.GetFileNameWithoutExtension(project.ProjectFile.Name)}."); 478InteractionService.DisplaySuccess(InitCommandStrings.AspireInitializationComplete); 497InteractionService.DisplayError("Single-file AppHost template not found."); 507InteractionService.DisplaySuccess(InitCommandStrings.AspireInitializationComplete); 602var packagesFromChannels = await InteractionService.ShowStatusAsync("Searching for available template versions...", async () => 645InteractionService.DisplayEmptyLine(); 646InteractionService.DisplayMarkdown(templateSelectionMessage); 647InteractionService.DisplayEmptyLine();
Commands\NewCommand.cs (3)
103var templateCommand = new TemplateCommand(template, ExecuteAsync, _features, _updateNotifier, _executionContext, InteractionService); 127if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, _features, _hostEnvironment, cancellationToken)) 136if (templateResult.OutputPath is not null && ExtensionHelper.IsExtensionHost(InteractionService, out var extensionInteractionService, out _))
Commands\PipelineCommandBase.cs (30)
108if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, _features, _hostEnvironment, cancellationToken)) 157appHostCompatibilityCheck = await AppHostHelper.CheckAppHostCompatibilityAsync(_runner, InteractionService, effectiveAppHostFile, _telemetry, ExecutionContext.WorkingDirectory, cancellationToken); 175var buildExitCode = await AppHostHelper.BuildAppHostAsync(_runner, InteractionService, effectiveAppHostFile, buildOptions, ExecutionContext.WorkingDirectory, cancellationToken); 181InteractionService.DisplayLines(buildOutputCollector.GetLines()); 182InteractionService.DisplayError(InteractionServiceStrings.ProjectCouldNotBeBuilt); 216InteractionService.DisplayMessage("bug", InteractionServiceStrings.WaitingForDebuggerToAttachToAppHost); 219var backchannel = await InteractionService.ShowStatusAsync($":hammer_and_wrench: {GetProgressMessage(parseResult)}", async () => 252InteractionService.DisplayLines(operationOutputCollector.GetLines()); 261InteractionService.DisplayError(GetCanceledMessage()); 268return HandleProjectLocatorException(ex, InteractionService); 274return InteractionService.DisplayIncompatibleVersionError( 283InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.ErrorConnectingToAppHost, ex.Message)); 284InteractionService.DisplayLines(operationOutputCollector.GetLines()); 291InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.UnexpectedErrorOccurred, ex.Message)); 327InteractionService.DisplaySubtleMessage($"[[DEBUG]] Step {stepCounter++}: {statusText}", escapeMarkup: false); 336InteractionService.DisplaySubtleMessage($"[[DEBUG]] Step {activity.Data.Id}: {status} - {statusText}", escapeMarkup: false); 371InteractionService.DisplaySubtleMessage(formattedMessage, escapeMarkup: false); 382InteractionService.DisplaySubtleMessage($"[[DEBUG]] Task {activity.Data.Id} ({stepId}): {status} - {statusText}", escapeMarkup: false); 386InteractionService.DisplaySubtleMessage($"[[DEBUG]] {completionMessage}", escapeMarkup: false); 392InteractionService.DisplaySubtleMessage($"[[DEBUG]] Task {activity.Data.Id} ({stepId}): {statusText}", escapeMarkup: false); 404InteractionService.DisplaySubtleMessage($"[[DEBUG]] {OperationCompletedPrefix}: {status} - {statusText}", escapeMarkup: false); 741InteractionService.DisplayError(error); 747InputType.Text => await InteractionService.PromptForStringAsync( 753InputType.SecretText => await InteractionService.PromptForStringAsync( 762InputType.Boolean => (await InteractionService.ConfirmAsync(promptText, defaultValue: ParseBooleanValue(input.Value), cancellationToken: cancellationToken)).ToString().ToLowerInvariant(), 766_ => await InteractionService.PromptForStringAsync(promptText, defaultValue: input.Value, required: input.Required, cancellationToken: cancellationToken) 774return await InteractionService.PromptForStringAsync(promptText, defaultValue: input.Value, required: input.Required, cancellationToken: cancellationToken); 788var (value, displayText) = await InteractionService.PromptForSelectionAsync( 796return await InteractionService.PromptForStringAsync(promptText, defaultValue: input.Value, required: input.Required, cancellationToken: cancellationToken); 816return await InteractionService.PromptForStringAsync(
Commands\RunCommand.cs (21)
79if (ExtensionHelper.IsExtensionHost(InteractionService, out _, out _)) 92var isExtensionHost = ExtensionHelper.IsExtensionHost(InteractionService, out _, out _); 97if (ExtensionHelper.IsExtensionHost(InteractionService, out var extensionInteractionService, out _) 106if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, _features, _hostEnvironment, cancellationToken)) 153var buildExitCode = await AppHostHelper.BuildAppHostAsync(_runner, InteractionService, effectiveAppHostFile, buildOptions, ExecutionContext.WorkingDirectory, cancellationToken); 157InteractionService.DisplayLines(buildOutputCollector.GetLines()); 158InteractionService.DisplayError(InteractionServiceStrings.ProjectCouldNotBeBuilt); 171appHostCompatibilityCheck = await AppHostHelper.CheckAppHostCompatibilityAsync(_runner, InteractionService, effectiveAppHostFile, _telemetry, ExecutionContext.WorkingDirectory, cancellationToken); 221var backchannel = await InteractionService.ShowStatusAsync(isExtensionHost ? InteractionServiceStrings.BuildingAppHost : RunCommandStrings.ConnectingToAppHost, async () => { return await backchannelCompletitionSource.Task.WaitAsync(cancellationToken); }); 227var dashboardUrls = await InteractionService.ShowStatusAsync(RunCommandStrings.StartingDashboard, async () => { return await backchannel.GetDashboardUrlsAsync(cancellationToken); }); 231InteractionService.DisplayError(RunCommandStrings.DashboardFailedToStart); 232InteractionService.DisplayLines(runOutputCollector.GetLines()); 330if (ExtensionHelper.IsExtensionHost(InteractionService, out extensionInteractionService, out _)) 341InteractionService.DisplayCancellationMessage(); 346return HandleProjectLocatorException(ex, InteractionService); 350return InteractionService.DisplayIncompatibleVersionError( 357InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, TemplatingStrings.CertificateTrustError, ex.Message.EscapeMarkup())); 362InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.ErrorConnectingToAppHost, ex.Message.EscapeMarkup())); 363InteractionService.DisplayLines(runOutputCollector.GetLines()); 368InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.UnexpectedErrorOccurred, ex.Message.EscapeMarkup())); 369InteractionService.DisplayLines(runOutputCollector.GetLines());
Commands\UpdateCommand.cs (16)
96InteractionService.DisplayError("CLI self-update is not available in this environment."); 115var channel = await InteractionService.PromptForSelectionAsync( 126var shouldUpdateCli = await InteractionService.ConfirmAsync( 141InteractionService.DisplayError(message); 152var shouldUpdateCli = await InteractionService.ConfirmAsync( 164return HandleProjectLocatorException(ex, InteractionService); 178quality = await InteractionService.PromptForSelectionAsync( 191InteractionService.DisplayError("Unable to determine the current executable path."); 195InteractionService.DisplayMessage("package", $"Current CLI location: {currentExePath}"); 196InteractionService.DisplayMessage("up_arrow", $"Updating to quality level: {quality}"); 209InteractionService.DisplayError($"Failed to update CLI: {ex.Message}"); 234InteractionService.DisplayMessage("package", "Extracting new CLI..."); 249InteractionService.DisplayMessage("floppy_disk", "Backing up current CLI..."); 262InteractionService.DisplayMessage("wrench", $"Installing new CLI to {installDir}..."); 285InteractionService.DisplayMessage("information", $"Note: {installDir} is not in your PATH. Add it to use the updated CLI globally."); 389InteractionService.DisplaySuccess($"Updated to version: {version}");