1 write to InteractionService
aspire (1)
Commands\BaseCommand.cs (1)
26
InteractionService
= interactionService;
201 references to InteractionService
aspire (201)
Commands\AddCommand.cs (13)
73
if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller,
InteractionService
, _features, _hostEnvironment, cancellationToken))
96
var packagesWithChannels = await
InteractionService
.ShowStatusAsync(
139
InteractionService
.DisplayError(AddCommandStrings.NoPackagesFound);
167
var addPackageResult = await
InteractionService
.ShowStatusAsync(
190
InteractionService
.DisplayLines(outputCollector.GetLines());
191
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.PackageInstallationFailed, addPackageResult));
196
InteractionService
.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.PackageAddedSuccessfully, selectedNuGetPackage.Package.Id, selectedNuGetPackage.Package.Version));
202
return HandleProjectLocatorException(ex,
InteractionService
);
206
InteractionService
.DisplayCancellationMessage();
211
InteractionService
.DisplayError(ex.Message);
216
InteractionService
.DisplayLines(outputCollector.GetLines());
217
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.ErrorOccurredWhileAddingPackage, ex.Message));
255
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\InitCommand.cs (52)
117
if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller,
InteractionService
, _features, _hostEnvironment, cancellationToken))
132
InteractionService
.DisplayEmptyLine();
133
InteractionService
.DisplayMessage("information", string.Format(CultureInfo.CurrentCulture, InitCommandStrings.SolutionDetected, initContext.SelectedSolutionFile.Name));
134
InteractionService
.DisplayEmptyLine();
139
InteractionService
.DisplayEmptyLine();
140
InteractionService
.DisplayMessage("information", InitCommandStrings.NoSolutionFoundCreatingSingleFileAppHost);
141
InteractionService
.DisplayEmptyLine();
151
var (getSolutionExitCode, solutionProjects) = await
InteractionService
.ShowStatusAsync("Reading solution...", async () =>
167
InteractionService
.DisplayLines(initContext.GetSolutionProjectsOutputCollector.GetLines());
168
InteractionService
.DisplayError("Failed to get projects from solution.");
174
_ = await
InteractionService
.ShowStatusAsync("Evaluating existing projects...", async () =>
184
InteractionService
.DisplayMessage("check_mark", InitCommandStrings.SolutionAlreadyInitialized);
200
InteractionService
.DisplayEmptyLine();
201
InteractionService
.DisplayMarkdown(addExecutableProjectsMessage);
202
InteractionService
.DisplayEmptyLine();
204
var selectedProjects = await
InteractionService
.PromptForSelectionsAsync(
215
InteractionService
.DisplayEmptyLine();
216
InteractionService
.DisplayMessage("information", "The following projects will be added to the AppHost:");
217
InteractionService
.DisplayEmptyLine();
221
InteractionService
.DisplayMessage("check_box_with_check", project.ProjectFile.Name);
233
InteractionService
.DisplayEmptyLine();
234
InteractionService
.DisplayMarkdown(addServiceDefaultsMessage);
235
InteractionService
.DisplayEmptyLine();
244
var selection = await
InteractionService
.PromptForSelectionAsync(
257
initContext.ProjectsToAddServiceDefaultsTo = await
InteractionService
.PromptForSelectionsAsync(
275
var nugetConfigPrompter = new NuGetConfigPrompter(
InteractionService
);
292
var templateInstallResult = await
InteractionService
.ShowStatusAsync(
314
InteractionService
.DisplayLines(initContext.InstallTemplateOutputCollector.GetLines());
315
InteractionService
.DisplayError("Failed to install Aspire templates.");
320
var createResult = await
InteractionService
.ShowStatusAsync(
341
InteractionService
.DisplayLines(initContext.NewProjectOutputCollector.GetLines());
342
InteractionService
.DisplayError($"Failed to create Aspire projects. Exit code: {createResult}");
353
InteractionService
.DisplayError("Failed to find created AppHost or ServiceDefaults projects in template output.");
375
var addAppHostResult = await
InteractionService
.ShowStatusAsync(
394
InteractionService
.DisplayLines(initContext.AddAppHostToSolutionOutputCollector.GetLines());
395
InteractionService
.DisplayError($"Failed to add AppHost project to solution. Exit code: {addAppHostResult}");
401
var addServiceDefaultsResult = await
InteractionService
.ShowStatusAsync(
420
InteractionService
.DisplayLines(initContext.AddServiceDefaultsToSolutionOutputCollector.GetLines());
421
InteractionService
.DisplayError($"Failed to add ServiceDefaults project to solution. Exit code: {addServiceDefaultsResult}");
434
var addRefResult = await
InteractionService
.ShowStatusAsync(
452
InteractionService
.DisplayLines(outputCollector.GetLines());
453
InteractionService
.DisplayError($"Failed to add reference to {Path.GetFileNameWithoutExtension(project.ProjectFile.Name)}.");
468
var addRefResult = await
InteractionService
.ShowStatusAsync(
486
InteractionService
.DisplayLines(outputCollector.GetLines());
487
InteractionService
.DisplayError($"Failed to add ServiceDefaults reference to {Path.GetFileNameWithoutExtension(project.ProjectFile.Name)}.");
495
InteractionService
.DisplaySuccess(InitCommandStrings.AspireInitializationComplete);
514
InteractionService
.DisplayError("Single-file AppHost template not found.");
524
InteractionService
.DisplaySuccess(InitCommandStrings.AspireInitializationComplete);
648
var packagesFromChannels = await
InteractionService
.ShowStatusAsync("Searching for available template versions...", async () =>
698
InteractionService
.DisplayEmptyLine();
699
InteractionService
.DisplayMarkdown(templateSelectionMessage);
700
InteractionService
.DisplayEmptyLine();
Commands\NewCommand.cs (3)
115
var templateCommand = new TemplateCommand(template, ExecuteAsync, _features, _updateNotifier, _executionContext,
InteractionService
);
139
if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller,
InteractionService
, _features, _hostEnvironment, cancellationToken))
148
if (templateResult.OutputPath is not null && ExtensionHelper.IsExtensionHost(
InteractionService
, out var extensionInteractionService, out _))
Commands\PipelineCommandBase.cs (33)
112
if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller,
InteractionService
, _features, _hostEnvironment, cancellationToken))
161
appHostCompatibilityCheck = await AppHostHelper.CheckAppHostCompatibilityAsync(_runner,
InteractionService
, effectiveAppHostFile, _telemetry, ExecutionContext.WorkingDirectory, cancellationToken);
179
var buildExitCode = await AppHostHelper.BuildAppHostAsync(_runner,
InteractionService
, effectiveAppHostFile, buildOptions, ExecutionContext.WorkingDirectory, cancellationToken);
185
InteractionService
.DisplayLines(buildOutputCollector.GetLines());
186
InteractionService
.DisplayError(InteractionServiceStrings.ProjectCouldNotBeBuilt);
220
InteractionService
.DisplayMessage("bug", InteractionServiceStrings.WaitingForDebuggerToAttachToAppHost);
223
var backchannel = await
InteractionService
.ShowStatusAsync($":hammer_and_wrench: {GetProgressMessage(parseResult)}", async () =>
253
InteractionService
.DisplayLines(operationOutputCollector.GetLines());
264
InteractionService
.DisplayLines(operationOutputCollector.GetLines());
276
InteractionService
.DisplayError(GetCanceledMessage());
283
return HandleProjectLocatorException(ex,
InteractionService
);
289
return
InteractionService
.DisplayIncompatibleVersionError(
298
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.ErrorConnectingToAppHost, ex.Message));
299
InteractionService
.DisplayLines(operationOutputCollector.GetLines());
306
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.AppHostConnectionLost, ex.Message));
307
InteractionService
.DisplayLines(operationOutputCollector.GetLines());
314
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.UnexpectedErrorOccurred, ex.Message));
350
InteractionService
.DisplaySubtleMessage($"[[DEBUG]] Step {stepCounter++}: {statusText}", escapeMarkup: false);
359
InteractionService
.DisplaySubtleMessage($"[[DEBUG]] Step {activity.Data.Id}: {status} - {statusText}", escapeMarkup: false);
394
InteractionService
.DisplaySubtleMessage(formattedMessage, escapeMarkup: false);
405
InteractionService
.DisplaySubtleMessage($"[[DEBUG]] Task {activity.Data.Id} ({stepId}): {status} - {statusText}", escapeMarkup: false);
409
InteractionService
.DisplaySubtleMessage($"[[DEBUG]] {completionMessage}", escapeMarkup: false);
415
InteractionService
.DisplaySubtleMessage($"[[DEBUG]] Task {activity.Data.Id} ({stepId}): {statusText}", escapeMarkup: false);
427
InteractionService
.DisplaySubtleMessage($"[[DEBUG]] {OperationCompletedPrefix}: {status} - {statusText}", escapeMarkup: false);
764
InteractionService
.DisplayError(error);
770
InputType.Text => await
InteractionService
.PromptForStringAsync(
776
InputType.SecretText => await
InteractionService
.PromptForStringAsync(
785
InputType.Boolean => (await
InteractionService
.ConfirmAsync(promptText, defaultValue: ParseBooleanValue(input.Value), cancellationToken: cancellationToken)).ToString().ToLowerInvariant(),
789
_ => await
InteractionService
.PromptForStringAsync(promptText, defaultValue: input.Value?.EscapeMarkup(), required: input.Required, cancellationToken: cancellationToken)
797
return await
InteractionService
.PromptForStringAsync(promptText, defaultValue: input.Value?.EscapeMarkup(), required: input.Required, cancellationToken: cancellationToken);
811
var (value, displayText) = await
InteractionService
.PromptForSelectionAsync(
819
return await
InteractionService
.PromptForStringAsync(promptText, defaultValue: input.Value?.EscapeMarkup(), required: input.Required, cancellationToken: cancellationToken);
839
return await
InteractionService
.PromptForStringAsync(
Commands\RunCommand.cs (23)
91
if (ExtensionHelper.IsExtensionHost(
InteractionService
, out _, out _))
104
var isExtensionHost = ExtensionHelper.IsExtensionHost(
InteractionService
, out _, out _);
112
if (ExtensionHelper.IsExtensionHost(
InteractionService
, out var extensionInteractionService, out _)
121
if (!await SdkInstallHelper.EnsureSdkInstalledAsync(_sdkInstaller,
InteractionService
, _features, _hostEnvironment, cancellationToken))
177
var buildExitCode = await AppHostHelper.BuildAppHostAsync(_runner,
InteractionService
, effectiveAppHostFile, buildOptions, ExecutionContext.WorkingDirectory, cancellationToken);
181
InteractionService
.DisplayLines(buildOutputCollector.GetLines());
182
InteractionService
.DisplayError(InteractionServiceStrings.ProjectCouldNotBeBuilt);
195
appHostCompatibilityCheck = await AppHostHelper.CheckAppHostCompatibilityAsync(_runner,
InteractionService
, effectiveAppHostFile, _telemetry, ExecutionContext.WorkingDirectory, cancellationToken);
245
var backchannel = await
InteractionService
.ShowStatusAsync(isExtensionHost ? InteractionServiceStrings.BuildingAppHost : RunCommandStrings.ConnectingToAppHost, async () => { return await backchannelCompletitionSource.Task.WaitAsync(cancellationToken); });
251
var dashboardUrls = await
InteractionService
.ShowStatusAsync(RunCommandStrings.StartingDashboard, async () => { return await backchannel.GetDashboardUrlsAsync(cancellationToken); });
255
InteractionService
.DisplayError(RunCommandStrings.DashboardFailedToStart);
256
InteractionService
.DisplayLines(runOutputCollector.GetLines());
354
if (ExtensionHelper.IsExtensionHost(
InteractionService
, out extensionInteractionService, out _))
365
InteractionService
.DisplayCancellationMessage();
370
return HandleProjectLocatorException(ex,
InteractionService
);
374
return
InteractionService
.DisplayIncompatibleVersionError(
381
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, TemplatingStrings.CertificateTrustError, ex.Message.EscapeMarkup()));
386
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.ErrorConnectingToAppHost, ex.Message.EscapeMarkup()));
387
InteractionService
.DisplayLines(runOutputCollector.GetLines());
392
InteractionService
.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.UnexpectedErrorOccurred, ex.Message.EscapeMarkup()));
393
InteractionService
.DisplayLines(runOutputCollector.GetLines());
552
InteractionService
.DisplayMessage("stop_sign", $"Stopping previous instance (AppHost PID: {appHostInfo.ProcessId.ToString(CultureInfo.InvariantCulture)}, CLI PID: {cliPidText})");
562
InteractionService
.DisplaySuccess(RunCommandStrings.RunningInstanceStopped);
Commands\UpdateCommand.cs (22)
119
InteractionService
.DisplayMessage("information", UpdateCommandStrings.DotNetToolSelfUpdateMessage);
120
InteractionService
.DisplayPlainText(" dotnet tool update -g Aspire.Cli");
126
InteractionService
.DisplayError("CLI self-update is not available in this environment.");
136
InteractionService
.DisplayCancellationMessage();
172
channel = await
InteractionService
.PromptForSelectionAsync(
194
var shouldUpdateCli = await
InteractionService
.ConfirmAsync(
209
InteractionService
.DisplayError(message);
215
InteractionService
.DisplayError(message);
226
var shouldUpdateCli = await
InteractionService
.ConfirmAsync(
238
return HandleProjectLocatorException(ex,
InteractionService
);
242
InteractionService
.DisplayCancellationMessage();
259
channel = await
InteractionService
.PromptForSelectionAsync(
272
InteractionService
.DisplayError("Unable to determine the current executable path.");
276
InteractionService
.DisplayMessage("package", $"Current CLI location: {currentExePath}");
277
InteractionService
.DisplayMessage("up_arrow", $"Updating to channel: {channel}");
293
InteractionService
.DisplayCancellationMessage();
299
InteractionService
.DisplayError($"Failed to update CLI: {ex.Message}");
324
InteractionService
.DisplayMessage("package", "Extracting new CLI...");
339
InteractionService
.DisplayMessage("floppy_disk", "Backing up current CLI...");
352
InteractionService
.DisplayMessage("wrench", $"Installing new CLI to {installDir}...");
375
InteractionService
.DisplayMessage("information", $"Note: {installDir} is not in your PATH. Add it to use the updated CLI globally.");
479
InteractionService
.DisplaySuccess($"Updated to version: {version}");