| Property | Value |
|---|---|
| Severity | Warning |
| Category | AOT Testing |
| Code fix | No |
| Analyzer | Al1408AvoidActivatorCreateInstanceAnalyzer |
| Enabled by default | Yes |
Activator.CreateInstance uses reflection to create instances at runtime. In Native AOT, this requires the target type's constructor to be preserved. Use explicit construction, factory patterns, or annotate with [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructors)].