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