> ## 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.

# AL0094 - Avoid 'dynamic' keyword in AOT

> dynamic requires Reflection.Emit which is not available in AOT

Source: [Al0094AvoidDynamicKeywordAnalyzer.cs](https://github.com/ANcpLua/ANcpLua.Analyzers/blob/main/src/ANcpLua.Analyzers/Analyzers/Al0094AvoidDynamicKeywordAnalyzer.cs)

## Description

The `dynamic` keyword relies on `Reflection.Emit` which is unavailable in Native AOT. Use strongly-typed alternatives.

## Bad Code

```csharp theme={null}
dynamic obj = GetResponse();
Console.WriteLine(obj.Name);
```

## Good Code

```csharp theme={null}
var obj = GetResponse();
Console.WriteLine(obj.Name);
// Or use JsonElement / strongly-typed deserialization
```

## Properties

* **Category**: AOT Testing
* **Severity**: Warning
* **Enabled by default**: True
* **Code fix available**: False

## Configuration

```editorconfig theme={null}
dotnet_diagnostic.AL0094.severity = warning
```
