Skip to content
Docs Try Aspire
Docs Try

NameValidationPolicyAnnotation

Class sealed net8.0
📦 Aspire.Hosting v13.3.0
Represents an annotation that customizes the name validation rules applied to a resource when it is added to the application model.
namespace Aspire.Hosting.ApplicationModel;
public sealed class NameValidationPolicyAnnotation
: Aspire.Hosting.ApplicationModel.IResourceAnnotation
{
// ...
}
By default, resource names must be 1–64 ASCII characters long, start with a letter, contain only letters, digits, and hyphens, and not contain consecutive or trailing hyphens. Use this annotation to relax individual rules. The NameValidationPolicyAnnotation.None policy disables every rule, which is useful for internal resources (such as installers or rebuilders) that append suffixes to user-provided resource names and are never deployed.