Compiler Error ASPIREAZURE005
Это содержимое пока не доступно на вашем языке.
‘Aspire.Hosting.Azure.IBicepOutputReferenceProvider’ is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
The IBicepOutputReferenceProvider interface represents a value that’s published as a Bicep output reference, even though the output isn’t known when the value is created. For example, a value might refer to the client ID of a managed identity that Aspire creates only while it prepares the app model for publishing. The interface has a single method, GetOutputReference, which returns the BicepOutputReference to use, or null when no output is available. Azure publishers treat a value that implements this interface as the output that it returns.
This interface is experimental and might change in future releases. The C# compiler reports ASPIREAZURE005 when your code uses it.
Example
Section titled “Example”The following code generates ASPIREAZURE005:
using Aspire.Hosting.Azure;
// Implementing IBicepOutputReferenceProvider generates ASPIREAZURE005internal sealed class DeferredOutputValue(Func<BicepOutputReference?> resolve) : IBicepOutputReferenceProvider{ public BicepOutputReference? GetOutputReference() => resolve();}TypeScript AppHosts can’t use this interface, so they don’t report this diagnostic.
To correct this error
Section titled “To correct this error”Suppress the error with one of the following methods:
-
Set the severity of the rule in the .editorconfig file.
.editorconfig [*.{cs,vb}]dotnet_diagnostic.ASPIREAZURE005.severity = noneFor more information about editor config files, see Configuration files for code analysis rules.
-
Add the following
PropertyGroupto your project file:C# project file <PropertyGroup><NoWarn>$(NoWarn);ASPIREAZURE005</NoWarn></PropertyGroup> -
Add the following property directive to a file-based AppHost:
AppHost.cs #:property NoWarn=ASPIREAZURE005 -
Suppress in code with the
#pragma warning disable ASPIREAZURE005directive:Suppressing the error #pragma warning disable ASPIREAZURE005internal sealed class DeferredOutputValue(Func<BicepOutputReference?> resolve): IBicepOutputReferenceProvider{public BicepOutputReference? GetOutputReference() => resolve();}#pragma warning restore ASPIREAZURE005