Skip to content

Respond to IL2026 warnings in DataProtection originating from EncryptedXml #47695

@eerhardt

Description

@eerhardt

With dotnet/runtime#84468, EncryptedXml is now marked as RequiresUnreferencedCode. This is because

The algorithm implementations referenced in the XML payload might be removed. Ensure the required algorithm implementations are preserved in your application.

From discussion in #47410 (comment), we should:

  1. Figure out the list of commonly used crypto algorithms used by DataProtection, and add [DynamicDependency] attributes for them.
  2. We also add some trimming/aot tests to ensure DataProtection works correctly when trimmed.
  3. DataProtection then suppresses the warnings coming from System.Security.Cryptography.Xml

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions