The model validation attributes MaxLength/MinLength are incompatible with native-aot #58683
Unanswered
sudoudaisuke
asked this question in
Q&A
Replies: 2 comments
-
Hello, |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you for your response. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using
System.ComponentModel.DataAnnotations.MaxLengthAttribute
for request model validation. However, MaxLengthAttribute is incompatible with native-aot (IL2026). How can I validate my model?I found a validation option that supports source generation, but not for asp.net.
dotnet: 8.0
https://github.com/dotnet/runtime/blob/main/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/MaxLengthAttribute.cs#L28
https://learn.microsoft.com/en-us/dotnet/core/extensions/options-validation-generator
Beta Was this translation helpful? Give feedback.
All reactions