1 write to InteractionService
aspire (1)
Commands\BaseCommand.cs (1)
26
InteractionService
= interactionService;
189 references to InteractionService
aspire (189)
Commands\AddCommand.cs (13)
73
if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller,
InteractionService
, _features, _hostEnvironment, cancellationToken))
96
var packagesWithChannels = await
InteractionService
.ShowStatusAsync(
132
InteractionService
.DisplayError(AddCommandStrings.NoPackagesFound);
160
var addPackageResult = await
InteractionService
.ShowStatusAsync(
183
InteractionService
.DisplayLines(outputCollector.GetLines());
184
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.PackageInstallationFailed, addPackageResult));
189
InteractionService
.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.PackageAddedSuccessfully, selectedNuGetPackage.Package.Id, selectedNuGetPackage.Package.Version));
195
return HandleProjectLocatorException(ex,
InteractionService
);
199
InteractionService
.DisplayCancellationMessage();
204
InteractionService
.DisplayError(ex.Message);
209
InteractionService
.DisplayLines(outputCollector.GetLines());
210
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.ErrorOccurredWhileAddingPackage, ex.Message));
248
InteractionService
.DisplaySubtleMessage(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.NoPackagesMatchedSearchTerm, searchTerm));
Commands\BaseCommand.cs (1)
48
InteractionService
.DisplayEmptyLine();
Commands\CacheCommand.cs (4)
21
var clearCommand = new ClearCommand(
InteractionService
, features, updateNotifier, executionContext);
114
InteractionService
.DisplayMessage("information", CacheCommandStrings.CacheAlreadyEmpty);
118
InteractionService
.DisplaySuccess(CacheCommandStrings.CacheCleared);
125
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, CacheCommandStrings.CacheClearFailed, ex.Message));
Commands\ConfigCommand.cs (26)
34
var getCommand = new GetCommand(configurationService,
InteractionService
, features, updateNotifier, executionContext);
35
var setCommand = new SetCommand(configurationService,
InteractionService
, features, updateNotifier, executionContext);
36
var listCommand = new ListCommand(configurationService,
InteractionService
, features, updateNotifier, executionContext);
37
var deleteCommand = new DeleteCommand(configurationService,
InteractionService
, features, updateNotifier, executionContext);
88
InteractionService
.DisplayError(ErrorStrings.ConfigurationKeyRequired);
97
var key = await
InteractionService
.PromptForStringAsync(ConfigCommandStrings.GetCommand_PromptForKey, required: true, cancellationToken: cancellationToken);
107
InteractionService
.DisplayPlainText(value);
112
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ConfigurationKeyNotFound, key));
152
InteractionService
.DisplayError(ErrorStrings.ConfigurationKeyRequired);
158
InteractionService
.DisplayError(ErrorStrings.ConfigurationValueRequired);
167
var key = await
InteractionService
.PromptForStringAsync(ConfigCommandStrings.SetCommand_PromptForKey, required: true, cancellationToken: cancellationToken);
168
var value = await
InteractionService
.PromptForStringAsync(ConfigCommandStrings.SetCommand_PromptForValue, required: true, cancellationToken: cancellationToken);
169
var isGlobal = await
InteractionService
.PromptForSelectionAsync(
183
InteractionService
.DisplaySuccess(isGlobal
193
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ErrorSettingConfiguration, ex.Message));
211
if (
InteractionService
is ExtensionInteractionService extensionInteractionService)
225
InteractionService
.DisplayMessage("information", ConfigCommandStrings.NoConfigurationValuesFound);
229
InteractionService
.DisplayLines(allConfig.Select(kvp => ("stdout", $"{kvp.Key}={kvp.Value}")));
262
InteractionService
.DisplayError(ErrorStrings.ConfigurationKeyRequired);
271
var key = await
InteractionService
.PromptForStringAsync(ConfigCommandStrings.DeleteCommand_PromptForKey, required: true, cancellationToken: cancellationToken);
276
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ConfigurationKeyNotFound, key));
280
var isGlobal = await
InteractionService
.PromptForSelectionAsync(
299
InteractionService
.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, ConfigCommandStrings.ConfigurationKeyDeletedGlobally, key));
303
InteractionService
.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, ConfigCommandStrings.ConfigurationKeyDeletedLocally, key));
310
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ConfigurationKeyNotFound, key));
316
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ErrorDeletingConfiguration, ex.Message));
Commands\ExecCommand.cs (23)
90
if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller,
InteractionService
, _features, _hostEnvironment, cancellationToken))
106
InteractionService
.DisplayError(ExecCommandStrings.TargetResourceNotSpecified);
114
InteractionService
.DisplayError(ExecCommandStrings.NoCommandSpecified);
122
InteractionService
.DisplayError(ExecCommandStrings.FailedToParseCommand);
148
InteractionService
.DisplayError(ErrorStrings.CommandNotSupportedWithSingleFileAppHost);
160
appHostCompatibilityCheck = await AppHostHelper.CheckAppHostCompatibilityAsync(_runner,
InteractionService
, effectiveAppHostProjectFile, _telemetry, ExecutionContext.WorkingDirectory, cancellationToken);
198
backchannel = await
InteractionService
.ShowStatusAsync(
206
InteractionService
.DisplayMessage(emoji: "bug", InteractionServiceStrings.WaitingForDebuggerToAttachToAppHost);
216
commandExitCode = await
InteractionService
.ShowStatusAsync<int?>(
225
InteractionService
.WriteConsoleLog(output.Text, output.LineNumber, output.Type, output.IsErrorMessage);
239
_ = await
InteractionService
.ShowStatusAsync<int>(
260
InteractionService
.DisplayLines(runOutputCollector.GetLines());
261
InteractionService
.DisplayError(RunCommandStrings.ProjectCouldNotBeRun);
271
InteractionService
.DisplayLines(runOutputCollector.GetLines());
272
InteractionService
.DisplayError(RunCommandStrings.ProjectCouldNotBeRun);
278
InteractionService
.DisplayCancellationMessage();
283
return HandleProjectLocatorException(ex,
InteractionService
);
287
return
InteractionService
.DisplayIncompatibleVersionError(
294
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, TemplatingStrings.CertificateTrustError, ex.Message));
299
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.ErrorConnectingToAppHost, ex.Message));
300
InteractionService
.DisplayLines(runOutputCollector.GetLines());
305
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.UnexpectedErrorOccurred, ex.Message));
306
InteractionService
.DisplayLines(runOutputCollector.GetLines());
Commands\InitCommand.cs (52)
100
if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller,
InteractionService
, _features, _hostEnvironment, cancellationToken))
115
InteractionService
.DisplayEmptyLine();
116
InteractionService
.DisplayMessage("information", string.Format(CultureInfo.CurrentCulture, InitCommandStrings.SolutionDetected, initContext.SelectedSolutionFile.Name));
117
InteractionService
.DisplayEmptyLine();
122
InteractionService
.DisplayEmptyLine();
123
InteractionService
.DisplayMessage("information", InitCommandStrings.NoSolutionFoundCreatingSingleFileAppHost);
124
InteractionService
.DisplayEmptyLine();
134
var (getSolutionExitCode, solutionProjects) = await
InteractionService
.ShowStatusAsync("Reading solution...", async () =>
150
InteractionService
.DisplayLines(initContext.GetSolutionProjectsOutputCollector.GetLines());
151
InteractionService
.DisplayError("Failed to get projects from solution.");
157
_ = await
InteractionService
.ShowStatusAsync("Evaluating existing projects...", async () =>
167
InteractionService
.DisplayMessage("check_mark", InitCommandStrings.SolutionAlreadyInitialized);
183
InteractionService
.DisplayEmptyLine();
184
InteractionService
.DisplayMarkdown(addExecutableProjectsMessage);
185
InteractionService
.DisplayEmptyLine();
187
var selectedProjects = await
InteractionService
.PromptForSelectionsAsync(
198
InteractionService
.DisplayEmptyLine();
199
InteractionService
.DisplayMessage("information", "The following projects will be added to the AppHost:");
200
InteractionService
.DisplayEmptyLine();
204
InteractionService
.DisplayMessage("check_box_with_check", project.ProjectFile.Name);
216
InteractionService
.DisplayEmptyLine();
217
InteractionService
.DisplayMarkdown(addServiceDefaultsMessage);
218
InteractionService
.DisplayEmptyLine();
227
var selection = await
InteractionService
.PromptForSelectionAsync(
240
initContext.ProjectsToAddServiceDefaultsTo = await
InteractionService
.PromptForSelectionsAsync(
258
var nugetConfigPrompter = new NuGetConfigPrompter(
InteractionService
);
275
var templateInstallResult = await
InteractionService
.ShowStatusAsync(
297
InteractionService
.DisplayLines(initContext.InstallTemplateOutputCollector.GetLines());
298
InteractionService
.DisplayError("Failed to install Aspire templates.");
303
var createResult = await
InteractionService
.ShowStatusAsync(
324
InteractionService
.DisplayLines(initContext.NewProjectOutputCollector.GetLines());
325
InteractionService
.DisplayError($"Failed to create Aspire projects. Exit code: {createResult}");
336
InteractionService
.DisplayError("Failed to find created AppHost or ServiceDefaults projects in template output.");
358
var addAppHostResult = await
InteractionService
.ShowStatusAsync(
377
InteractionService
.DisplayLines(initContext.AddAppHostToSolutionOutputCollector.GetLines());
378
InteractionService
.DisplayError($"Failed to add AppHost project to solution. Exit code: {addAppHostResult}");
384
var addServiceDefaultsResult = await
InteractionService
.ShowStatusAsync(
403
InteractionService
.DisplayLines(initContext.AddServiceDefaultsToSolutionOutputCollector.GetLines());
404
InteractionService
.DisplayError($"Failed to add ServiceDefaults project to solution. Exit code: {addServiceDefaultsResult}");
417
var addRefResult = await
InteractionService
.ShowStatusAsync(
435
InteractionService
.DisplayLines(outputCollector.GetLines());
436
InteractionService
.DisplayError($"Failed to add reference to {Path.GetFileNameWithoutExtension(project.ProjectFile.Name)}.");
451
var addRefResult = await
InteractionService
.ShowStatusAsync(
469
InteractionService
.DisplayLines(outputCollector.GetLines());
470
InteractionService
.DisplayError($"Failed to add ServiceDefaults reference to {Path.GetFileNameWithoutExtension(project.ProjectFile.Name)}.");
478
InteractionService
.DisplaySuccess(InitCommandStrings.AspireInitializationComplete);
497
InteractionService
.DisplayError("Single-file AppHost template not found.");
507
InteractionService
.DisplaySuccess(InitCommandStrings.AspireInitializationComplete);
602
var packagesFromChannels = await
InteractionService
.ShowStatusAsync("Searching for available template versions...", async () =>
645
InteractionService
.DisplayEmptyLine();
646
InteractionService
.DisplayMarkdown(templateSelectionMessage);
647
InteractionService
.DisplayEmptyLine();
Commands\NewCommand.cs (3)
103
var templateCommand = new TemplateCommand(template, ExecuteAsync, _features, _updateNotifier, _executionContext,
InteractionService
);
127
if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller,
InteractionService
, _features, _hostEnvironment, cancellationToken))
136
if (templateResult.OutputPath is not null && ExtensionHelper.IsExtensionHost(
InteractionService
, out var extensionInteractionService, out _))
Commands\PipelineCommandBase.cs (30)
108
if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller,
InteractionService
, _features, _hostEnvironment, cancellationToken))
157
appHostCompatibilityCheck = await AppHostHelper.CheckAppHostCompatibilityAsync(_runner,
InteractionService
, effectiveAppHostFile, _telemetry, ExecutionContext.WorkingDirectory, cancellationToken);
175
var buildExitCode = await AppHostHelper.BuildAppHostAsync(_runner,
InteractionService
, effectiveAppHostFile, buildOptions, ExecutionContext.WorkingDirectory, cancellationToken);
181
InteractionService
.DisplayLines(buildOutputCollector.GetLines());
182
InteractionService
.DisplayError(InteractionServiceStrings.ProjectCouldNotBeBuilt);
216
InteractionService
.DisplayMessage("bug", InteractionServiceStrings.WaitingForDebuggerToAttachToAppHost);
219
var backchannel = await
InteractionService
.ShowStatusAsync($":hammer_and_wrench: {GetProgressMessage(parseResult)}", async () =>
252
InteractionService
.DisplayLines(operationOutputCollector.GetLines());
261
InteractionService
.DisplayError(GetCanceledMessage());
268
return HandleProjectLocatorException(ex,
InteractionService
);
274
return
InteractionService
.DisplayIncompatibleVersionError(
283
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.ErrorConnectingToAppHost, ex.Message));
284
InteractionService
.DisplayLines(operationOutputCollector.GetLines());
291
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.UnexpectedErrorOccurred, ex.Message));
327
InteractionService
.DisplaySubtleMessage($"[[DEBUG]] Step {stepCounter++}: {statusText}", escapeMarkup: false);
336
InteractionService
.DisplaySubtleMessage($"[[DEBUG]] Step {activity.Data.Id}: {status} - {statusText}", escapeMarkup: false);
371
InteractionService
.DisplaySubtleMessage(formattedMessage, escapeMarkup: false);
382
InteractionService
.DisplaySubtleMessage($"[[DEBUG]] Task {activity.Data.Id} ({stepId}): {status} - {statusText}", escapeMarkup: false);
386
InteractionService
.DisplaySubtleMessage($"[[DEBUG]] {completionMessage}", escapeMarkup: false);
392
InteractionService
.DisplaySubtleMessage($"[[DEBUG]] Task {activity.Data.Id} ({stepId}): {statusText}", escapeMarkup: false);
404
InteractionService
.DisplaySubtleMessage($"[[DEBUG]] {OperationCompletedPrefix}: {status} - {statusText}", escapeMarkup: false);
741
InteractionService
.DisplayError(error);
747
InputType.Text => await
InteractionService
.PromptForStringAsync(
753
InputType.SecretText => await
InteractionService
.PromptForStringAsync(
762
InputType.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)
774
return await
InteractionService
.PromptForStringAsync(promptText, defaultValue: input.Value, required: input.Required, cancellationToken: cancellationToken);
788
var (value, displayText) = await
InteractionService
.PromptForSelectionAsync(
796
return await
InteractionService
.PromptForStringAsync(promptText, defaultValue: input.Value, required: input.Required, cancellationToken: cancellationToken);
816
return await
InteractionService
.PromptForStringAsync(
Commands\RunCommand.cs (21)
79
if (ExtensionHelper.IsExtensionHost(
InteractionService
, out _, out _))
92
var isExtensionHost = ExtensionHelper.IsExtensionHost(
InteractionService
, out _, out _);
97
if (ExtensionHelper.IsExtensionHost(
InteractionService
, out var extensionInteractionService, out _)
106
if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller,
InteractionService
, _features, _hostEnvironment, cancellationToken))
153
var buildExitCode = await AppHostHelper.BuildAppHostAsync(_runner,
InteractionService
, effectiveAppHostFile, buildOptions, ExecutionContext.WorkingDirectory, cancellationToken);
157
InteractionService
.DisplayLines(buildOutputCollector.GetLines());
158
InteractionService
.DisplayError(InteractionServiceStrings.ProjectCouldNotBeBuilt);
171
appHostCompatibilityCheck = await AppHostHelper.CheckAppHostCompatibilityAsync(_runner,
InteractionService
, effectiveAppHostFile, _telemetry, ExecutionContext.WorkingDirectory, cancellationToken);
221
var backchannel = await
InteractionService
.ShowStatusAsync(isExtensionHost ? InteractionServiceStrings.BuildingAppHost : RunCommandStrings.ConnectingToAppHost, async () => { return await backchannelCompletitionSource.Task.WaitAsync(cancellationToken); });
227
var dashboardUrls = await
InteractionService
.ShowStatusAsync(RunCommandStrings.StartingDashboard, async () => { return await backchannel.GetDashboardUrlsAsync(cancellationToken); });
231
InteractionService
.DisplayError(RunCommandStrings.DashboardFailedToStart);
232
InteractionService
.DisplayLines(runOutputCollector.GetLines());
330
if (ExtensionHelper.IsExtensionHost(
InteractionService
, out extensionInteractionService, out _))
341
InteractionService
.DisplayCancellationMessage();
346
return HandleProjectLocatorException(ex,
InteractionService
);
350
return
InteractionService
.DisplayIncompatibleVersionError(
357
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, TemplatingStrings.CertificateTrustError, ex.Message.EscapeMarkup()));
362
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.ErrorConnectingToAppHost, ex.Message.EscapeMarkup()));
363
InteractionService
.DisplayLines(runOutputCollector.GetLines());
368
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.UnexpectedErrorOccurred, ex.Message.EscapeMarkup()));
369
InteractionService
.DisplayLines(runOutputCollector.GetLines());
Commands\UpdateCommand.cs (16)
96
InteractionService
.DisplayError("CLI self-update is not available in this environment.");
115
var channel = await
InteractionService
.PromptForSelectionAsync(
126
var shouldUpdateCli = await
InteractionService
.ConfirmAsync(
141
InteractionService
.DisplayError(message);
152
var shouldUpdateCli = await
InteractionService
.ConfirmAsync(
164
return HandleProjectLocatorException(ex,
InteractionService
);
178
quality = await
InteractionService
.PromptForSelectionAsync(
191
InteractionService
.DisplayError("Unable to determine the current executable path.");
195
InteractionService
.DisplayMessage("package", $"Current CLI location: {currentExePath}");
196
InteractionService
.DisplayMessage("up_arrow", $"Updating to quality level: {quality}");
209
InteractionService
.DisplayError($"Failed to update CLI: {ex.Message}");
234
InteractionService
.DisplayMessage("package", "Extracting new CLI...");
249
InteractionService
.DisplayMessage("floppy_disk", "Backing up current CLI...");
262
InteractionService
.DisplayMessage("wrench", $"Installing new CLI to {installDir}...");
285
InteractionService
.DisplayMessage("information", $"Note: {installDir} is not in your PATH. Add it to use the updated CLI globally.");
389
InteractionService
.DisplaySuccess($"Updated to version: {version}");