Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/frontend/config/sidebar/diagnostic.topics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ export const diagnosticTopics: StarlightSidebarTopicsUserConfig = {
label: 'ASPIREFILESYSTEM001',
link: '/diagnostics/aspirefilesystem001',
},
{
label: 'ASPIREINTERACTION001',
link: '/diagnostics/aspireinteraction001',
},
{
label: 'ASPIREPIPELINES004',
link: '/diagnostics/aspirepipelines004',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
title: Compiler Warning ASPIREINTERACTION001
description: Learn more about compiler Warning ASPIREINTERACTION001. Interaction service types and members are for evaluation purposes only and are subject to change or removal in future updates.
---

import { Badge } from '@astrojs/starlight/components';

<Badge text="Version introduced: 13.0" variant="note" size="large" class:list={'mb-1'} />

> Interaction service types and members are for evaluation purposes only and are subject to change or removal in future updates. Suppress this diagnostic to proceed.

This diagnostic warns when using the experimental `IInteractionService` interface and related interaction APIs. These APIs provide the ability to prompt users for input, request confirmation, and display messages in the Aspire dashboard or CLI during publish and deploy operations.

### Example generating diagnostic

```csharp title="AppHost.cs"
var builder = DistributedApplication.CreateBuilder(args);

// Using IInteractionService from an IServiceProvider instance
var interactionService = serviceProvider.GetRequiredService<IInteractionService>();
if (interactionService.IsAvailable)
{
var result = await interactionService.PromptConfirmationAsync(
title: "Confirmation",
message: "Are you sure you want to proceed?");
}
```

The diagnostic is triggered because `IInteractionService` is marked with the `[Experimental("ASPIREINTERACTION001")]` attribute.

## Understanding the diagnostic

The `IInteractionService` interface provides user interaction functionality for Aspire applications:

- **Message display**: Show dialogs and notifications in the dashboard
- **User confirmation**: Request confirmation before destructive operations
- **Input collection**: Prompt users for single or multiple input values
- **Context awareness**: Works in both dashboard UI and CLI contexts

This API is experimental because the interaction patterns and API surface may evolve based on usage patterns and feedback from deployment scenarios.

### Related types

- **`IInteractionService`**: Interface for prompting users and displaying messages
- **`InteractionInput`**: Defines input fields for user prompts
- **`InputType`**: Enum for input field types (Text, SecretText, Choice, Boolean, Number)
- **`InputLoadOptions`**: Configuration for dynamic input loading
- **`MessageBoxInteractionOptions`**: Options for message box dialogs
- **`NotificationInteractionOptions`**: Options for notification messages
- **`PromptMessageBoxAsync()`**: Displays a modal dialog box
- **`PromptNotificationAsync()`**: Displays a non-modal notification
- **`PromptConfirmationAsync()`**: Prompts for user confirmation
- **`PromptInputAsync()`**: Prompts for a single input value
- **`PromptInputsAsync()`**: Prompts for multiple input values

## Suppressing the diagnostic

The diagnostic can be suppressed using one of several methods:

### Suppressing in .editorconfig

```ini title=".editorconfig"
[*.{cs,vb}]
dotnet_diagnostic.ASPIREINTERACTION001.severity = none
```

### Suppressing in a project file

```xml title="YourProject.csproj"
<PropertyGroup>
<NoWarn>$(NoWarn);ASPIREINTERACTION001</NoWarn>
</PropertyGroup>
```

### Suppressing in source code

```csharp
#pragma warning disable ASPIREINTERACTION001
var interactionService = serviceProvider.GetRequiredService<IInteractionService>();
var result = await interactionService.PromptConfirmationAsync(
title: "Confirmation",
message: "Are you sure?");
#pragma warning restore ASPIREINTERACTION001
```

## See also

- [Interaction service (Preview)](/extensibility/interaction-service/)
1 change: 1 addition & 0 deletions src/frontend/src/content/docs/diagnostics/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ The following table lists the possible MSBuild and analyzer warnings and errors
| [ASPIRECOSMOSDB001](/diagnostics/aspirecosmosdb001/) | (Experimental) Error | `RunAsPreviewEmulator` is for evaluation purposes only and is subject to change or removal in future updates. |
| [ASPIREDOCKERFILEBUILDER001](/diagnostics/aspiredockerfilebuilder001/) | (Experimental) Warning | Dockerfile builder types and members are for evaluation purposes only and are subject to change or removal in future updates. |
| [ASPIREFILESYSTEM001](/diagnostics/aspirefilesystem001/) | (Experimental) Warning | File system service types and members are for evaluation purposes only and are subject to change or removal in future updates. |
| [ASPIREINTERACTION001](/diagnostics/aspireinteraction001/) | (Experimental) Warning | Interaction service types and members are for evaluation purposes only and are subject to change or removal in future updates. |
| [ASPIREPIPELINES004](/diagnostics/aspirepipelines004/) | (Experimental) Warning | Type is for evaluation purposes only and is subject to change or removal in future updates. |
| [ASPIREPROBES001](/diagnostics/aspireprobes001/) | (Experimental) Warning | Probe-related types and members are for evaluation purposes only and are subject to change or removal in future updates. |
| [ASPIREUSERSECRETS001](/diagnostics/aspireusersecrets001/) | (Experimental) Warning | Type is for evaluation purposes only and is subject to change or removal in future updates. |
Expand Down
Loading