इसे छोड़कर कंटेंट पर जाएं
दस्तावेज़आज़माएं

Compiler Warning ASPIRERADIUS006

यह कंटेंट अभी तक आपकी भाषा में उपलब्ध नहीं है।

Version introduced: 13.6

Radius secret store 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 Radius secret-store APIs from the Aspire.Hosting.Radius integration, including:

  • AddRadiusSecretStore and WithSecretStore
  • their population callbacks, such as WithData, WithExistingSecret, and WithSealedSecret, and their consumer callbacks
  • RadiusSecretStoreType

These APIs declare a Radius secret store and populate it from Aspire secret parameters, existing cluster secrets, or GitOps sealed secrets.

The following code generates ASPIRERADIUS006:

AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
var user = builder.AddParameter("db-user", secret: true);
var pass = builder.AddParameter("db-pass", secret: true);
builder.AddRadiusSecretStore("db-creds", RadiusSecretStoreType.BasicAuthentication)
.WithData(d =>
{
d.Add("username", user);
d.Add("password", pass);
});
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.ASPIRERADIUS006.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);ASPIRERADIUS006</NoWarn>
    </PropertyGroup>
  • Suppress in code with the #pragma warning disable ASPIRERADIUS006 directive:

    Suppressing the warning
    var apiKey = builder.AddParameter("api-key", secret: true);
    #pragma warning disable ASPIRERADIUS006
    builder.AddRadiusSecretStore("api-creds", RadiusSecretStoreType.Generic)
    .WithData(d => d.Add("api-key", apiKey));
    #pragma warning restore ASPIRERADIUS006