Diagnostic code · ARA0503
Reflection or dynamic code
The profile forbids a reflection or dynamic-code API that is not already reported by ARA0400. Such access can bypass generated registration and break reload or NativeAOT. The edit is rejected; the last good code keeps running.
Common causes
- Reflective member discovery or delegate invocation, such as
Type.GetFieldsorDelegate.DynamicInvoke. - Access to disallowed reflection, loader, expression-tree or dynamic-runtime APIs.
Fixes
Use generated registration and serializers, static references and direct typed calls.
Replace reflective dispatch with an explicit typed interface or a generated dispatch table.
Code:
ARA0503Constant:
cs::API_REFLECTIONReported by: Ara.Analyzers