# AspireExportIgnoreAttribute

- Kind: `class`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.3.0`
- Namespace: `Aspire.Hosting`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/Ats/AspireExportIgnoreAttribute.cs)
- Inherits: `Attribute`

Excludes a property, method, or type from ATS export when the containing type uses [AspireExportAttribute.ExposeProperties](/reference/api/csharp/aspire.hosting/aspireexportattribute/properties.md#exposeproperties) or [AspireExportAttribute.ExposeMethods](/reference/api/csharp/aspire.hosting/aspireexportattribute/properties.md#exposemethods).

## Definition

```csharp
namespace Aspire.Hosting;

public sealed class AspireExportIgnoreAttribute
    : System.Attribute
{
    // ...
}
```

## 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.

## Constructors

- [AspireExportIgnoreAttribute](/reference/api/csharp/aspire.hosting/aspireexportignoreattribute/constructors.md#constructor)

## Properties

- [Reason](/reference/api/csharp/aspire.hosting/aspireexportignoreattribute/properties.md#reason) : `string?` `get; set` -- Gets or sets the reason why this member is excluded from ATS export.

## Examples

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