Description
Currently, C# assemblies are building reference assemblies via ProduceReferenceAssembly (corresponding to the CSC flag -refout).
This causes several issues:
- Reference assemblies contain internal types due to WPF's use of
InternalsVisibleTo
in many of its assemblies. - Due to this, several reference assemblies may have dangling type references as we move toward the same reference assembly surface as .NET Framework. This was also the case in .NET Framework for some reference assemblies, but this wasn't as strictly enforced.
Currently, the known dangling references are in the PresentationCore
and PresentationFramework
reference assemblies, the later only when PresentationUI
's reference assembly is removed.
To fix these, we want to switch to using the GenAPI tool so that we can tailor the content of the reference assemblies to only contain necessary API surface area.
Our builds directly use ProjectReference
for needed assemblies that are in the same repository and will alter these for those that are not available in the same repository (via WpfProjectReference.targets). We likely will have to update this mechanic if internal building assemblies require internals from the reference assemblies.
- Call GenAPI to generate
PresentationCore
's reference assembly - Trim output to only needed types
- Do the same for the rest of the publicly building C# assemblies
- Test package ingestion against dotnet-wpf-int to validate WpfProjectReference.targets
- Fix issues as needed
- Apply GenAPI changes to dotnet-wpf-int C# assemblies