Salta ai contenuti
DocumentazioneProva Aspire
DocumentazioneProva

Compiler Error ASPIREACANAMING002

Questi contenuti non sono ancora disponibili nella tua lingua.

Version introduced: 13.5

WithUniqueResourceNaming is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

The following code generates ASPIREACANAMING002:

AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
var env1 = builder.AddAzureContainerAppEnvironment("cae1")
.WithUniqueResourceNaming();

Suppress the error with either of the following methods:

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

    .editorconfig
    [*.{cs,vb}]
    dotnet_diagnostic.ASPIREACANAMING002.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);ASPIREACANAMING002</NoWarn>
    </PropertyGroup>
  • Suppress in code with the #pragma warning disable ASPIREACANAMING002 directive.