> ## Documentation Index
> Fetch the complete documentation index at: https://ancplua.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Polyfills

> Modern C# features for netstandard2.0 targets.

When targeting `netstandard2.0`, the SDK injects polyfills for modern C# features. The polyfill source files are maintained in [ANcpLua.Roslyn.Utilities](/utilities/polyfills) as the single source of truth.

| Feature                | What it enables                      |
| ---------------------- | ------------------------------------ |
| `Index` / `Range`      | `array[^1]`, `array[1..3]` syntax    |
| `IsExternalInit`       | `record` types and `init` properties |
| Nullability attributes | `[NotNull]`, `[MaybeNull]`, etc.     |
| `TimeProvider`         | Testable time abstraction            |
| `Lock`                 | `System.Threading.Lock` polyfill     |
| Trim/AOT attributes    | `[RequiresUnreferencedCode]`, etc.   |
| String extensions      | `string.Contains(StringComparison)`  |

## Opt-out Control

All polyfills are enabled by default. Disable individual categories or all at once:

```xml theme={null}
<PropertyGroup>
  <!-- Disable a specific polyfill -->
  <InjectTimeProviderPolyfill>false</InjectTimeProviderPolyfill>
  <InjectLockPolyfill>false</InjectLockPolyfill>

  <!-- Disable ALL polyfills -->
  <InjectAllPolyfillsOnLegacy>false</InjectAllPolyfillsOnLegacy>
</PropertyGroup>
```

See [Polyfills Reference](/utilities/polyfills) for the complete list of available polyfills and opt-out properties.

<Note>
  Polyfills are only injected for `netstandard2.0` / `netstandard2.1` targets.
  .NET 10 projects don't need them.
</Note>
