# ResourceNameAttribute

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

Signifies that a parameter represents a resource name.

Decorate `String` parameters representing resource names with this attribute, e.g.:

```csharp
public static IResourceBuilder<MyResource> AddCustomResource(this IDistributedApplicationBuilder builder, [ResourceName] string name)
```

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public sealed class ResourceNameAttribute
    : System.Attribute,
      Aspire.Hosting.ApplicationModel.IModelNameParameter
{
    // ...
}
```

## Remarks

This API supports analyzers in Aspire.Hosting.Analyzers.

## Constructors

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