Skip to content
Docs Try Aspire

AspireExportAttribute Properties

Class Properties 7 members
Marks a method, type, or assembly-level type as an ATS (Aspire Type System) export.
Description Section titled Description nullable string?
Gets or sets a description of what this export does.
public string? Description { get; set; }
Gets or sets whether to expose public instance methods of this type as ATS capabilities.
public bool ExposeMethods { get; set; }

When true, the type's public instance methods are automatically exposed as capabilities (unless marked with AspireExportIgnoreAttribute).

Method capabilities are named as {Package}/{TypeName}.{methodName} (camelCase method name). The first parameter of the capability will be a handle to the instance.

ExposeProperties Section titled ExposeProperties bool
Gets or sets whether to expose properties of this type as ATS capabilities.
public bool ExposeProperties { get; set; }

When true, the type's public instance properties that return ATS-compatible types are automatically exposed as get/set capabilities (unless marked with AspireExportIgnoreAttribute).

Use this for context types passed to callbacks (like EnvironmentCallbackContext) that provide access to runtime state.

Property capabilities are named as:

  • {Package}/{TypeName}.{propertyName} for getters (camelCase property name)
  • {Package}/{TypeName}.set{PropertyName} for setters (writable properties only)

Id Section titled Id nullable string?
Gets the method name for capability exports.
public string? Id { get; }

The full capability ID is computed as {AssemblyName}/{Id}.

This is null for type exports.

MethodName Section titled MethodName nullable string?
Gets or sets the method name to use in generated polyglot SDKs.
public string? MethodName { get; set; }

When not specified, the method name from AspireExportAttribute.Id is used directly.

Use this property to override the generated name when disambiguation is needed (e.g., to avoid collisions with another integration's method of the same name). Each language generator will apply its own formatting convention (camelCase for TypeScript, snake_case for Python, etc.).

RunSyncOnBackgroundThread Section titled RunSyncOnBackgroundThread bool
Gets or sets whether synchronous exported methods should be invoked on a background thread by the ATS dispatcher.
public bool RunSyncOnBackgroundThread { get; set; }

Set this to true for synchronous exports that may invoke synchronous callback delegates which in turn re-enter the remote host through ATS. Running the export on a background thread allows the JSON-RPC request loop to continue processing nested callback and capability invocations while the synchronous method waits for the callback to complete.

This setting only affects synchronous exported methods. Async exports that already return Tasks.Task or Tasks.Task`1 are awaited normally and do not use this option.

When applied to a type, this setting also applies to exported members discovered from that type unless an individual member overrides it.

Type Section titled Type nullable Type?
Gets or sets the CLR type for assembly-level type exports.
public Type? Type { get; set; }
Use this at assembly level to export types you don't own to ATS.