AspireExportIgnoreAttribute
Class sealed net8.0
Excludes a property, method, or type from ATS export when the containing type uses
AspireExportAttribute.ExposeProperties or AspireExportAttribute.ExposeMethods. namespace Aspire.Hosting;
public sealed class AspireExportIgnoreAttribute : System.Attribute{ // ...} Attribute
Remarks
Section titled Remarks Use this attribute on individual members to opt them out of automatic exposure when the containing type uses ExposeProperties = true or ExposeMethods = true.
This is useful when most members should be exposed but a few contain internal implementation details or types that shouldn't be part of the polyglot API.
Apply this attribute to a type to suppress all automatic export coverage checks for the type's members when the type is intentionally not part of the ATS surface.
Constructors1
Section titled ConstructorsProperties1
Section titled PropertiesExamples
Section titled Examples[AspireExport(ExposeProperties = true)]public class EnvironmentCallbackContext{ // Automatically exposed as capability public Dictionary<string, object> EnvironmentVariables { get; }
[AspireExportIgnore] // Not exposed - internal implementation detail public ILogger Logger { get; }}