# Compiler Warning ASPIREEXPORT007

<Badge
  text="Version introduced: 13.2"
  variant="note"
  size="large"
  class:list={'mb-1'}
/>

> Export ID '{0}' is already defined for target type '{1}'. Each export ID must be unique per target type.

This diagnostic warning is reported when two or more `[AspireExport]` methods in the same assembly use the same export ID for the same target type. Because the export ID becomes the method name in generated code for other language runtimes, duplicate export IDs for the same target type would result in ambiguous or overwritten API members.

## Example

The following code generates `ASPIREEXPORT007`:

```csharp title="C# — Integration.cs"
[AspireExport("withCache")]
public static IResourceBuilder<RedisResource> WithCache(
    IResourceBuilder<RedisResource> builder)
{
    return builder;
}

[AspireExport("withCache")]  // Duplicate ID for the same target type
public static IResourceBuilder<RedisResource> WithCacheAndPersistence(
    IResourceBuilder<RedisResource> builder)
{
    return builder.WithPersistence();
}
```

## To correct this warning

Use a unique export ID for each method targeting the same type:

```csharp title="C# — Integration.cs"
[AspireExport("withCache")]
public static IResourceBuilder<RedisResource> WithCache(
    IResourceBuilder<RedisResource> builder)
{
    return builder;
}

[AspireExport("withCacheAndPersistence")]
public static IResourceBuilder<RedisResource> WithCacheAndPersistence(
    IResourceBuilder<RedisResource> builder)
{
    return builder.WithPersistence();
}
```

## Suppress the warning

Suppress the warning with either of the following methods:

- Set the severity of the rule in the _.editorconfig_ file.

  ```ini title=".editorconfig"
  [*.{cs,vb}]
  dotnet_diagnostic.ASPIREEXPORT007.severity = none
  ```

  For more information about editor config files, see [Configuration files for code analysis rules](/diagnostics/overview/#suppress-in-the-editorconfig-file).

- Add the following `PropertyGroup` to your project file:

  ```xml title="C# project file"
  <PropertyGroup>
      <NoWarn>$(NoWarn);ASPIREEXPORT007</NoWarn>
  </PropertyGroup>
  ```