# PreferLocalPlacementAttribute

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

[NuGet package](https://www.nuget.org/packages/Microsoft.Orleans.Core.Abstractions) | [Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/Placement/PlacementAttribute.cs#L64)

```csharp
public sealed class PreferLocalPlacementAttribute : PlacementAttribute
```

Marks a grain class as using the [PreferLocalPlacement](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.preferlocalplacement/) policy.

## Remarks

If the host is not compatible with the grain type or if a grain receives an incompatible request, the grain will be placed on a random, compatible server.

## Constructors

- [PreferLocalPlacementAttribute](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.placement.preferlocalplacementattribute/constructors/constructor-61740b8d/)
