Salta ai contenuti
DocumentazioneProva Aspire
DocumentazioneProva

Compiler Warning ASPIRETERMINAL001

Questi contenuti non sono ancora disponibili nella tua lingua.

Version introduced: 13.5

Terminal configuration 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 warning is reported when using experimental terminal configuration APIs in Aspire, including:

  • WithTerminal extension method
  • TerminalOptions

WithTerminal opts a resource into a per-replica interactive terminal session that’s attachable from the Aspire CLI and dashboard.

The following code generates ASPIRETERMINAL001:

AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
builder.AddContainer("cache", "redis")
.WithTerminal();
builder.Build().Run();

Suppress the warning with one of the following methods:

  • Set the severity of the rule in the .editorconfig file.

    .editorconfig
    [*.{cs,vb}]
    dotnet_diagnostic.ASPIRETERMINAL001.severity = none

    For more information about editor config files, see Configuration files for code analysis rules.

  • Add the following PropertyGroup to your project file:

    C# project file
    <PropertyGroup>
    <NoWarn>$(NoWarn);ASPIRETERMINAL001</NoWarn>
    </PropertyGroup>
  • Suppress in code with the #pragma warning disable ASPIRETERMINAL001 directive:

    Suppressing the warning
    #pragma warning disable ASPIRETERMINAL001
    builder.AddContainer("cache", "redis")
    .WithTerminal();
    #pragma warning restore ASPIRETERMINAL001