TYPE

RequiresUnreferencedCodeAttribute

Marks code that may be incompatible with trimming.

Formal Syntax & Structure

csharp syntaxcsharp
[RequiresUnreferencedCode("Reason")]

Working Example

Example Snippetcsharp
// Documentary fragment; see lesson for context and imports.[RequiresUnreferencedCode("External metadata cannot be predicted.")]
C# & .NET Reference