跳转到内容

Compiler Error ASPIREAZURE001

此内容尚不支持你的语言。

Version introduced: 9.2

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

The Aspire Azure hosting integration now ships with a publisher. If you’re using any of the Aspire.Hosting.AzurePublisherExtensions.AddAzurePublisher* APIs, you might see a compiler error/warning indicating that the API is experimental. This behavior is expected, as the API is still in preview and the shape of this API is expected to change in the future.

The following code generates ASPIREAZURE001:

C# — AppHost.cs
builder.AddAzurePublisher();

Suppress the error with either of the following methods:

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

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

问 & 答协作社区讨论观看