Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft.Extensions.Compliance.Redaction is not trim/AOT compatible #5623

Open
eerhardt opened this issue Nov 11, 2024 · 0 comments
Open

Microsoft.Extensions.Compliance.Redaction is not trim/AOT compatible #5623

eerhardt opened this issue Nov 11, 2024 · 0 comments

Comments

@eerhardt
Copy link
Member

See

<IsAotCompatible>false</IsAotCompatible>
<NoWarn>$(NoWarn);IL2026</NoWarn>

Note that the comment above that line is not accurate. This is failing due to the following warning:

D:\git\extensions\artifacts\obj\Microsoft.Extensions.Compliance.Redaction\Release\net9.0\Microsoft.Extensions.Options.SourceGeneration\Microsoft.Extensions.Options.Generators.OptionsValidatorGenerator\Validators.g.cs(45): Trim analysis error IL2026: __OptionValidationStaticInstances.<Validators_g>F57694E33B5E2E27C63A3A57935189BA2F694DE286C5758AB3C2CDA117678B43A____Attributes..cctor(): Using member 'Microsoft.Shared.Data.Validation.LengthAttribute.LengthAttribute(Int32)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Uses reflection to get the 'Count' property on types that don't implement ICollection. This 'Count' property may be trimmed. Ensure it is preserved.

We should make this library trim/AOT compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants