Compiler Error ASPIREACADOMAINS001
यह कंटेंट अभी तक आपकी भाषा में उपलब्ध नहीं है।
Before Aspire 13.5, ConfigureCustomDomain was experimental and subject to change or removal in future updates, and using it required suppressing this diagnostic.
Aspire 9.0 introduces the ability to customize container app resources using any of the following extension methods:
Aspire.Hosting.AzureContainerAppProjectExtensions.PublishAsAzureContainerAppAspire.Hosting.AzureContainerAppContainerExtensions.PublishAsAzureContainerAppAspire.Hosting.AzureContainerAppExecutableExtensions.PublishAsAzureContainerApp
When you use one of these methods, the Azure Developer CLI (azd) can no longer preserve custom domains. Instead use the Aspire.Hosting.ContainerAppExtensions.ConfigureCustomDomain method to configure a custom domain within the Aspire AppHost.
Example
Section titled “Example”Before Aspire 13.5, the following code generated ASPIREACADOMAINS001:
var customDomain = builder.AddParameter("customDomain");var certificateName = builder.AddParameter("certificateName");
builder.AddProject<Projects.AzureContainerApps_ApiService>("api") .WithExternalHttpEndpoints() .PublishAsAzureContainerApp((infra, app) => { app.ConfigureCustomDomain(customDomain, certificateName); });To correct this error
Section titled “To correct this error”If you use Aspire 13.5 or later, you don’t need to suppress this diagnostic and can remove any existing ASPIREACADOMAINS001 suppressions.
If you use an Aspire version earlier than 13.5, suppress the diagnostic with one of the following methods:
-
Set the severity of the rule in the .editorconfig file.
.editorconfig [*.{cs,vb}]dotnet_diagnostic.ASPIREACADOMAINS001.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);ASPIREACADOMAINS001</NoWarn></PropertyGroup> -
Suppress in code with the
#pragma warning disable ASPIREACADOMAINS001directive.