Source: Al0101AvoidActivatorCreateInstanceAnalyzer.csDocumentation Index
Fetch the complete documentation index at: https://ancplua.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Description
Activator.CreateInstance() relies on reflection to create instances, which is not compatible with Native AOT trimming. Use direct construction or factory patterns.
Bad Code
Good Code
Properties
- Category: AOT Testing
- Severity: Warning
- Enabled by default: True
- Code fix available: False
