Skip to content
Docs Try Aspire

AspireExportIgnoreAttribute

Class sealed net8.0
📦 Aspire.Hosting v13.2.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

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.

[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; }
}