You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add option to keep/remove COM interfaces (#101087)
Adds an illink option that can be used to remove COM
interfaces (the existing behavior is to preserve COM interfaces
on marked types). If a type implements a COM interface that is
also marked elsewhere, it will still be kept even with
`--keep-com-interfaces false`. This includes windows runtime
interfaces under the same option name.
This eliminates some trim warnings in winforms due to
trim-incompatible code in Control's implementations of COM
interfaces like IPersistPropertyBag. Experimentally, this still
produces a working app for the scenario we've been testing
(https://github.com/dotnet/winforms/tree/main/src/System.Windows.Forms/tests/IntegrationTests/TrimTest).
For now, this just introduces the option without setting it by
default anywhere (or exposing it in MSBuild) so that we can opt
in from the winforms scenario. We might consider setting it
wherever `BuiltInComInteropSupport` is false.
Copy file name to clipboardexpand all lines: src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/UnusedComInterfaceIsKept.cs
+3
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,9 @@ public static void Main ()
21
21
[Guid("D7BB1889-3AB7-4681-A115-60CA9158FECA")]
22
22
interfaceIBar
23
23
{
24
+
// Trimming may remove members from COM interfaces
0 commit comments