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