By default, ReferenceTrimmer uses the Roslyn GetUsedAssemblyReferences API. For accurate results, you must enable C# XML documentation generation. If your repository does not already have this enabled, add the following configuration to your Directory.Build.props to enable documentation generation and suppress common XML-related warnings (CS0419, CS1570, CS1573, CS1574, CS1584, CS1591, and SA1602).
<PropertyGroup>
<!-- Documentation file generation is required for more accurate C# detection. -->
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- Suppress XML doc comment issues:
- CS0419: Ambiguous reference in cref attribute
- CS1570: XML comment has badly formed XML
- CS1573: Parameter has no matching param tag in the XML comment
- CS1574: XML comment has cref attribute that could not be resolved
- CS1584: XML comment has syntactically incorrect cref attribute
- CS1591: Missing XML comment for publicly visible type or member
- SA1602: Enumeration items should be documented
-->
<NoWarn>$(NoWarn);419;1570;1573;1574;1584;1591;SA1602</NoWarn>
</PropertyGroup>