# AspireExportAttribute Constructors

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [AspireExportAttribute](/reference/api/csharp/aspire.hosting/aspireexportattribute.md)
- Kind: `Constructors`
- Members: `3`

Marks a method, type, or assembly-level type as an ATS (Aspire Type System) export.

## AspireExportAttribute(string)

- Name: `Constructor(string)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/Ats/AspireExportAttribute.cs#L99-L102)

Initializes a new instance for a capability export (on methods) with an explicit capability ID.

```csharp
public sealed class AspireExportAttribute
{
    public AspireExportAttribute(
        string id)
    {
        // ...
    }
}
```

## Parameters

- `id` (`string`)
  The capability name for this method. The full capability ID is computed as `{AssemblyName}/{id}`. Use this overload only when disambiguation is needed (e.g., multiple overloads of the same method). When not specified, the capability ID is automatically derived from the method name using camelCase.

## AspireExportAttribute

- Name: `Constructor`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/Ats/AspireExportAttribute.cs#L113-L115)

Initializes a new instance for a type or method export.

```csharp
public sealed class AspireExportAttribute
{
    public AspireExportAttribute()
    {
        // ...
    }
}
```

## Remarks

For type exports, the type ID is automatically derived as `{AssemblyName}/{TypeName}`. Set [AspireExportAttribute.ExposeProperties](/reference/api/csharp/aspire.hosting/aspireexportattribute/properties.md#exposeproperties) to true for context types whose properties should be exposed as get/set capabilities. For method exports, the capability ID is automatically derived from the method name using camelCase.

## AspireExportAttribute(Type)

- Name: `Constructor(Type)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/Ats/AspireExportAttribute.cs#L131-L134)

Initializes a new instance for an assembly-level type export.

```csharp
public sealed class AspireExportAttribute
{
    public AspireExportAttribute(
        Type type)
    {
        // ...
    }
}
```

## Parameters

- `type` (`Type`)
  The CLR type to export to ATS.

## Remarks

Use this constructor at assembly level for types you don't own. The type ID is derived as `{type.Assembly.Name}/{type.Name}`.

## Examples

```csharp
[assembly: AspireExport(typeof(IConfiguration))]
// Type ID: Microsoft.Extensions.Configuration.Abstractions/IConfiguration
```
