# TraitAnnotation Constructors

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [TraitAnnotation](/reference/api/csharp/aspire.hosting/traitannotation.md)
- Kind: `Constructors`
- Members: `1`

Immutable, non-sensitive metadata attached to a resource. Multiple annotations with the same name represent multiple values.

<a id="constructor"></a>
<a id="constructor-string-string"></a>

## TraitAnnotation(string, string)

- Name: `Constructor(string, string)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/2d325b13709752ba6d9a943635c5e2940a2530c0/src/Aspire.Hosting/ApplicationModel/TraitAnnotation.cs#L19-L26)

Creates a resource trait.

```csharp
public sealed class TraitAnnotation
{
    public TraitAnnotation(
        string name,
        string value)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The case-sensitive trait name.
- `value` (`string`)
  The trait value. Traits are visible in dashboard and tooling output and must not contain secrets.
