-
-
Notifications
You must be signed in to change notification settings - Fork 114
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Several reflection calls lack proper [DynamicallyAccessedMembers] annotations, which can cause runtime failures under AOT trimming.
PropertyInjector.cs (Lines 244, 387, 393, 409)
Direct calls to metadata.ContainingType.GetProperty() without [DynamicallyAccessedMembers] annotations in InjectSourceGeneratedPropertyAsync and RecurseIntoNestedPropertiesCoreAsync. While methods have [UnconditionalSuppressMessage] for source-gen, the actual calls lack proper safeguards.
JsonExtensions.cs (Lines 68, 80)
classParameterTypes[i].FullName ?? "Unknown"Accesses FullName without checking for null Types. Generic type parameters or constructed types might return null FullName. No DynamicallyAccessedMembers annotation on input types.
Suggested Fix
- Annotate
metadata.ContainingTypewith[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] - Add null coalescing:
classParameterTypes[i]?.FullName ?? classParameterTypes[i]?.Name ?? "Unknown"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working