# GenerateSerializerContextAttribute&lt;T&gt;

Package: [Microsoft.Orleans.Serialization.Abstractions](/orleans/docs/api/csharp/microsoft.orleans.serialization.abstractions/) 10.0.0

[NuGet package](https://www.nuget.org/packages/Microsoft.Orleans.Serialization.Abstractions) | [Source](https://github.com/dotnet/orleans/blob/42682376d80e1176a952ba13aa2de25a307b576e/src/Orleans.Serialization.Abstractions/GenerateSerializerContextAttribute.cs#L16)

```csharp
public sealed class GenerateSerializerContextAttribute<T> : Attribute
```

Generates closed serializer and copier registrations for a root type and its serialization dependencies.

## Remarks

Apply this attribute to a partial class derived from `Orleans.Serialization.SerializerContext`. Each root must be a closed type supported by the context generator. Register the generated context using `AddSerializerContext` to enable explicit type lookup. Generic attributes require C# 11 or later.

## Type parameters

- `T`: The closed root type to register.

## Constructors

- [GenerateSerializerContextAttribute&lt;T&gt;](/orleans/docs/api/csharp/microsoft.orleans.serialization.abstractions/orleans.generateserializercontextattribute-1/constructors/constructor-348f09e3/)
