1 write to InteractionService
aspire (1)
Commands\BaseCommand.cs (1)
26InteractionService = interactionService;
169 references to InteractionService
aspire (169)
Commands\AddCommand.cs (13)
67if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, cancellationToken)) 90var packagesWithChannels = await InteractionService.ShowStatusAsync( 126InteractionService.DisplayError(AddCommandStrings.NoPackagesFound); 154var addPackageResult = await InteractionService.ShowStatusAsync( 177InteractionService.DisplayLines(outputCollector.GetLines()); 178InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.PackageInstallationFailed, addPackageResult)); 183InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.PackageAddedSuccessfully, selectedNuGetPackage.Package.Id, selectedNuGetPackage.Package.Version)); 189return HandleProjectLocatorException(ex, InteractionService); 193InteractionService.DisplayCancellationMessage(); 198InteractionService.DisplayError(ex.Message); 203InteractionService.DisplayLines(outputCollector.GetLines()); 204InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.ErrorOccurredWhileAddingPackage, ex.Message)); 242InteractionService.DisplaySubtleMessage(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.NoPackagesMatchedSearchTerm, searchTerm));
Commands\BaseCommand.cs (1)
48InteractionService.DisplayEmptyLine();
Commands\CacheCommand.cs (5)
21var clearCommand = new ClearCommand(InteractionService, features, updateNotifier, executionContext); 51InteractionService.DisplayMessage("information", CacheCommandStrings.CacheAlreadyEmpty); 86InteractionService.DisplayMessage("information", CacheCommandStrings.CacheAlreadyEmpty); 90InteractionService.DisplaySuccess(CacheCommandStrings.CacheCleared); 97InteractionService.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)
84if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, cancellationToken)) 100InteractionService.DisplayError(ExecCommandStrings.TargetResourceNotSpecified); 108InteractionService.DisplayError(ExecCommandStrings.NoCommandSpecified); 116InteractionService.DisplayError(ExecCommandStrings.FailedToParseCommand); 142InteractionService.DisplayError(ErrorStrings.CommandNotSupportedWithSingleFileAppHost); 154appHostCompatibilityCheck = await AppHostHelper.CheckAppHostCompatibilityAsync(_runner, InteractionService, effectiveAppHostProjectFile, _telemetry, ExecutionContext.WorkingDirectory, cancellationToken); 192backchannel = await InteractionService.ShowStatusAsync( 200InteractionService.DisplayMessage(emoji: "bug", InteractionServiceStrings.WaitingForDebuggerToAttachToAppHost); 210commandExitCode = await InteractionService.ShowStatusAsync<int?>( 219InteractionService.WriteConsoleLog(output.Text, output.LineNumber, output.Type, output.IsErrorMessage); 233_ = await InteractionService.ShowStatusAsync<int>( 254InteractionService.DisplayLines(runOutputCollector.GetLines()); 255InteractionService.DisplayError(RunCommandStrings.ProjectCouldNotBeRun); 265InteractionService.DisplayLines(runOutputCollector.GetLines()); 266InteractionService.DisplayError(RunCommandStrings.ProjectCouldNotBeRun); 272InteractionService.DisplayCancellationMessage(); 277return HandleProjectLocatorException(ex, InteractionService); 281return InteractionService.DisplayIncompatibleVersionError( 288InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, TemplatingStrings.CertificateTrustError, ex.Message)); 293InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.ErrorConnectingToAppHost, ex.Message)); 294InteractionService.DisplayLines(runOutputCollector.GetLines()); 299InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.UnexpectedErrorOccurred, ex.Message)); 300InteractionService.DisplayLines(runOutputCollector.GetLines());
Commands\InitCommand.cs (41)
97if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, cancellationToken)) 112InteractionService.DisplayEmptyLine(); 113InteractionService.DisplayMessage("information", string.Format(CultureInfo.CurrentCulture, InitCommandStrings.SolutionDetected, initContext.SelectedSolutionFile.Name)); 114InteractionService.DisplayEmptyLine(); 119InteractionService.DisplayEmptyLine(); 120InteractionService.DisplayMessage("information", InitCommandStrings.NoSolutionFoundCreatingSingleFileAppHost); 121InteractionService.DisplayEmptyLine(); 130var (getSolutionExitCode, solutionProjects) = await InteractionService.ShowStatusAsync("Reading solution...", async () => 140InteractionService.DisplayError("Failed to get projects from solution."); 146_ = await InteractionService.ShowStatusAsync("Evaluating existing projects...", async () => 156InteractionService.DisplayMessage("check_mark", InitCommandStrings.SolutionAlreadyInitialized); 172InteractionService.DisplayEmptyLine(); 173InteractionService.DisplayMarkdown(addExecutableProjectsMessage); 174InteractionService.DisplayEmptyLine(); 176var selectedProjects = await InteractionService.PromptForSelectionsAsync( 187InteractionService.DisplayEmptyLine(); 188InteractionService.DisplayMessage("information", "The following projects will be added to the AppHost:"); 189InteractionService.DisplayEmptyLine(); 193InteractionService.DisplayMessage("check_box_with_check", project.Name); 205InteractionService.DisplayEmptyLine(); 206InteractionService.DisplayMarkdown(addServiceDefaultsMessage); 207InteractionService.DisplayEmptyLine(); 216var selection = await InteractionService.PromptForSelectionAsync( 229initContext.ProjectsToAddServiceDefaultsTo = await InteractionService.PromptForSelectionsAsync( 255var templateInstallResult = await InteractionService.ShowStatusAsync( 272InteractionService.DisplayError("Failed to install Aspire templates."); 276var createResult = await InteractionService.ShowStatusAsync( 301InteractionService.DisplayError("Failed to find created AppHost or ServiceDefaults projects in template output."); 316var addResult = await InteractionService.ShowStatusAsync( 356var addRefResult = await InteractionService.ShowStatusAsync( 368InteractionService.DisplayError($"Failed to add reference to {Path.GetFileNameWithoutExtension(project.Name)}."); 379var addRefResult = await InteractionService.ShowStatusAsync( 391InteractionService.DisplayError($"Failed to add ServiceDefaults reference to {Path.GetFileNameWithoutExtension(project.Name)}."); 399InteractionService.DisplaySuccess(InitCommandStrings.AspireInitializationComplete); 422InteractionService.DisplayError("Single-file AppHost template not found."); 433InteractionService.DisplayError("AppHost template not found."); 444InteractionService.DisplaySuccess(InitCommandStrings.AspireInitializationComplete); 500var packagesFromChannels = await InteractionService.ShowStatusAsync("Searching for available template versions...", async () => 543InteractionService.DisplayEmptyLine(); 544InteractionService.DisplayMarkdown(templateSelectionMessage); 545InteractionService.DisplayEmptyLine();
Commands\NewCommand.cs (3)
100var templateCommand = new TemplateCommand(template, ExecuteAsync, _features, _updateNotifier, _executionContext, InteractionService); 124if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, cancellationToken)) 133if (templateResult.OutputPath is not null && ExtensionHelper.IsExtensionHost(InteractionService, out var extensionInteractionService, out _))
Commands\PublishCommandBase.cs (30)
85if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, cancellationToken)) 112InteractionService.DisplayError(ErrorStrings.SingleFileAppHostFeatureNotEnabled); 131appHostCompatibilityCheck = await AppHostHelper.CheckAppHostCompatibilityAsync(_runner, InteractionService, effectiveAppHostFile, _telemetry, ExecutionContext.WorkingDirectory, cancellationToken); 147var buildExitCode = await AppHostHelper.BuildAppHostAsync(_runner, InteractionService, effectiveAppHostFile, buildOptions, ExecutionContext.WorkingDirectory, cancellationToken); 151InteractionService.DisplayLines(buildOutputCollector.GetLines()); 152InteractionService.DisplayError(InteractionServiceStrings.ProjectCouldNotBeBuilt); 186InteractionService.DisplayMessage("bug", InteractionServiceStrings.WaitingForDebuggerToAttachToAppHost); 189var backchannel = await InteractionService.ShowStatusAsync($":hammer_and_wrench: {GetProgressMessage()}", async () => 214InteractionService.DisplayLines(operationOutputCollector.GetLines()); 221InteractionService.DisplayError(GetCanceledMessage()); 226return HandleProjectLocatorException(ex, InteractionService); 230return InteractionService.DisplayIncompatibleVersionError( 237InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.ErrorConnectingToAppHost, ex.Message)); 238InteractionService.DisplayLines(operationOutputCollector.GetLines()); 243InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.UnexpectedErrorOccurred, ex.Message)); 266InteractionService.DisplaySubtleMessage($"[DEBUG] Step {stepCounter++}: {activity.Data.StatusText}"); 274InteractionService.DisplaySubtleMessage($"[DEBUG] Step {activity.Data.Id}: {status} - {activity.Data.StatusText}"); 290InteractionService.DisplaySubtleMessage($"[DEBUG] Task {activity.Data.Id} ({stepId}): {status} - {activity.Data.StatusText}"); 293InteractionService.DisplaySubtleMessage($"[DEBUG] {activity.Data.CompletionMessage}"); 298InteractionService.DisplaySubtleMessage($"[DEBUG] Task {activity.Data.Id} ({stepId}): {activity.Data.StatusText}"); 309InteractionService.DisplaySubtleMessage($"[DEBUG] {OperationCompletedPrefix}: {status} - {publishingActivity.Data.StatusText}"); 575InteractionService.DisplayError(error); 581InputType.Text => await InteractionService.PromptForStringAsync( 587InputType.SecretText => await InteractionService.PromptForStringAsync( 596InputType.Boolean => (await InteractionService.ConfirmAsync(promptText, defaultValue: ParseBooleanValue(input.Value), cancellationToken: cancellationToken)).ToString().ToLowerInvariant(), 600_ => await InteractionService.PromptForStringAsync(promptText, defaultValue: input.Value, required: input.Required, cancellationToken: cancellationToken) 608return await InteractionService.PromptForStringAsync(promptText, defaultValue: input.Value, required: input.Required, cancellationToken: cancellationToken); 622var (value, displayText) = await InteractionService.PromptForSelectionAsync( 630return await InteractionService.PromptForStringAsync(promptText, defaultValue: input.Value, required: input.Required, cancellationToken: cancellationToken); 650return await InteractionService.PromptForStringAsync(
Commands\RunCommand.cs (23)
74if (ExtensionHelper.IsExtensionHost(InteractionService, out _, out _)) 87var isExtensionHost = ExtensionHelper.IsExtensionHost(InteractionService, out _, out _); 92if (ExtensionHelper.IsExtensionHost(InteractionService, out var extensionInteractionService, out _) 101if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, cancellationToken)) 126InteractionService.DisplayError(ErrorStrings.SingleFileAppHostFeatureNotEnabled); 156if (!ExtensionHelper.IsExtensionHost(InteractionService, out _, out var extensionBackchannel) 160var buildExitCode = await AppHostHelper.BuildAppHostAsync(_runner, InteractionService, effectiveAppHostFile, buildOptions, ExecutionContext.WorkingDirectory, cancellationToken); 164InteractionService.DisplayLines(buildOutputCollector.GetLines()); 165InteractionService.DisplayError(InteractionServiceStrings.ProjectCouldNotBeBuilt); 179appHostCompatibilityCheck = await AppHostHelper.CheckAppHostCompatibilityAsync(_runner, InteractionService, effectiveAppHostFile, _telemetry, ExecutionContext.WorkingDirectory, cancellationToken); 228var backchannel = await InteractionService.ShowStatusAsync(RunCommandStrings.ConnectingToAppHost, async () => { return await backchannelCompletitionSource.Task.WaitAsync(cancellationToken); }); 234var dashboardUrls = await InteractionService.ShowStatusAsync(RunCommandStrings.StartingDashboard, async () => { return await backchannel.GetDashboardUrlsAsync(cancellationToken); }); 238InteractionService.DisplayError(RunCommandStrings.DashboardFailedToStart); 239InteractionService.DisplayLines(runOutputCollector.GetLines()); 330if (ExtensionHelper.IsExtensionHost(InteractionService, out extensionInteractionService, out _)) 342InteractionService.DisplayCancellationMessage(); 347return HandleProjectLocatorException(ex, InteractionService); 351return InteractionService.DisplayIncompatibleVersionError( 358InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, TemplatingStrings.CertificateTrustError, ex.Message.EscapeMarkup())); 363InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.ErrorConnectingToAppHost, ex.Message.EscapeMarkup())); 364InteractionService.DisplayLines(runOutputCollector.GetLines()); 369InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.UnexpectedErrorOccurred, ex.Message.EscapeMarkup())); 370InteractionService.DisplayLines(runOutputCollector.GetLines());
Commands\UpdateCommand.cs (4)
49InteractionService.DisplayError(ErrorStrings.CommandNotSupportedWithSingleFileAppHost); 55var channel = await InteractionService.PromptForSelectionAsync(UpdateCommandStrings.SelectChannelPrompt, channels, (c) => c.Name, cancellationToken); 62InteractionService.DisplayError(message); 67return HandleProjectLocatorException(ex, InteractionService);