1 write to InteractionService
aspire (1)
Commands\BaseCommand.cs (1)
26InteractionService = interactionService;
127 references to InteractionService
aspire (127)
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\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 (29)
83if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, cancellationToken)) 110InteractionService.DisplayError(ErrorStrings.SingleFileAppHostFeatureNotEnabled); 129appHostCompatibilityCheck = await AppHostHelper.CheckAppHostCompatibilityAsync(_runner, InteractionService, effectiveAppHostFile, _telemetry, ExecutionContext.WorkingDirectory, cancellationToken); 145var buildExitCode = await AppHostHelper.BuildAppHostAsync(_runner, InteractionService, effectiveAppHostFile, buildOptions, ExecutionContext.WorkingDirectory, cancellationToken); 149InteractionService.DisplayLines(buildOutputCollector.GetLines()); 150InteractionService.DisplayError(InteractionServiceStrings.ProjectCouldNotBeBuilt); 184InteractionService.DisplayMessage("bug", InteractionServiceStrings.WaitingForDebuggerToAttachToAppHost); 187var backchannel = await InteractionService.ShowStatusAsync($":hammer_and_wrench: {GetProgressMessage()}", async () => 212InteractionService.DisplayLines(operationOutputCollector.GetLines()); 219InteractionService.DisplayError(GetCanceledMessage()); 224return HandleProjectLocatorException(ex, InteractionService); 228return InteractionService.DisplayIncompatibleVersionError( 235InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.ErrorConnectingToAppHost, ex.Message)); 236InteractionService.DisplayLines(operationOutputCollector.GetLines()); 241InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.UnexpectedErrorOccurred, ex.Message)); 264InteractionService.DisplaySubtleMessage($"[DEBUG] Step {stepCounter++}: {activity.Data.StatusText}"); 272InteractionService.DisplaySubtleMessage($"[DEBUG] Step {activity.Data.Id}: {status} - {activity.Data.StatusText}"); 288InteractionService.DisplaySubtleMessage($"[DEBUG] Task {activity.Data.Id} ({stepId}): {status} - {activity.Data.StatusText}"); 291InteractionService.DisplaySubtleMessage($"[DEBUG] {activity.Data.CompletionMessage}"); 296InteractionService.DisplaySubtleMessage($"[DEBUG] Task {activity.Data.Id} ({stepId}): {activity.Data.StatusText}"); 307InteractionService.DisplaySubtleMessage($"[DEBUG] {OperationCompletedPrefix}: {status} - {publishingActivity.Data.StatusText}"); 555InteractionService.DisplayError(error); 561InputType.Text => await InteractionService.PromptForStringAsync( 567InputType.SecretText => await InteractionService.PromptForStringAsync( 576InputType.Boolean => (await InteractionService.ConfirmAsync(promptText, defaultValue: ParseBooleanValue(input.Value), cancellationToken: cancellationToken)).ToString().ToLowerInvariant(), 580_ => await InteractionService.PromptForStringAsync(promptText, defaultValue: input.Value, required: input.Required, cancellationToken: cancellationToken) 588return await InteractionService.PromptForStringAsync(promptText, defaultValue: input.Value, required: input.Required, cancellationToken: cancellationToken); 593var selectedChoice = await InteractionService.PromptForSelectionAsync( 616return await InteractionService.PromptForStringAsync(
Commands\RunCommand.cs (23)
75if (ExtensionHelper.IsExtensionHost(InteractionService, out _, out _)) 88var isExtensionHost = ExtensionHelper.IsExtensionHost(InteractionService, out _, out _); 93if (ExtensionHelper.IsExtensionHost(InteractionService, out var extensionInteractionService, out _) 102if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller, InteractionService, cancellationToken)) 127InteractionService.DisplayError(ErrorStrings.SingleFileAppHostFeatureNotEnabled); 157if (!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); 227var backchannel = await InteractionService.ShowStatusAsync(RunCommandStrings.ConnectingToAppHost, async () => { return await backchannelCompletitionSource.Task.WaitAsync(cancellationToken); }); 233var dashboardUrls = await InteractionService.ShowStatusAsync(RunCommandStrings.StartingDashboard, async () => { return await backchannel.GetDashboardUrlsAsync(cancellationToken); }); 237InteractionService.DisplayError(RunCommandStrings.DashboardFailedToStart); 238InteractionService.DisplayLines(runOutputCollector.GetLines()); 329if (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 (4)
44InteractionService.DisplayError(ErrorStrings.CommandNotSupportedWithSingleFileAppHost); 50var channel = await InteractionService.PromptForSelectionAsync(UpdateCommandStrings.SelectChannelPrompt, channels, (c) => c.Name, cancellationToken); 57InteractionService.DisplayError(message); 62return HandleProjectLocatorException(ex, InteractionService);