You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix trimming warnings in validation source generator
Update DynamicallyAccessedMembers annotations on generated code to satisfy NativeAOT trimming requirements.
- **GeneratedValidatablePropertyInfo.ContainingType**: Changed from `PublicProperties|PublicConstructors` to `PublicProperties|NonPublicProperties` to match base class ValidatablePropertyInfo requirements
- **ValidationAttributeCache.CacheKey.ContainingType**: Added `PublicConstructors|NonPublicConstructors` to support `GetConstructors()` calls that access both public and non-public constructors.
- **ValidationAttributeCache.GetPropertyValidationAttributes**: Updated parameter annotation to include `PublicConstructors|NonPublicConstructors` for consistency with CacheKey.
Should fix trimming errors **IL2067**, **IL2072**, and **IL2075** that occurred when building NativeAOT and trimming test projects.
Copy file name to clipboardExpand all lines: src/Validation/test/Microsoft.Extensions.Validation.GeneratorTests/snapshots/ValidationsGeneratorTests.CanDiscoverGeneratedValidatableTypeAttribute#ValidatableInfoResolver.g.verified.cs
Copy file name to clipboardExpand all lines: src/Validation/test/Microsoft.Extensions.Validation.GeneratorTests/snapshots/ValidationsGeneratorTests.CanUseBothFrameworkAndGeneratedValidatableTypeAttributes#ValidatableInfoResolver.g.verified.cs
0 commit comments