Skip to content

Enable Built-in COM interop for ContentIsland sample#2100

Merged
niels9001 merged 2 commits intomicrosoft:mainfrom
Zakariathr22:BuiltInComInteropSupport
Feb 9, 2026
Merged

Enable Built-in COM interop for ContentIsland sample#2100
niels9001 merged 2 commits intomicrosoft:mainfrom
Zakariathr22:BuiltInComInteropSupport

Conversation

@Zakariathr22
Copy link
Contributor

Description

Explicitly enables built-in COM interop in the project by setting true in the .csproj file.
This ensures that the ContentIsland sample can load models without throwing a System.NotSupportedException when trimming is enabled.

Motivation and Context

How Has This Been Tested?

Tested by running the ContentIsland sample locally in both Release and Debug mode.

Screenshots (if appropriate):

None

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Copy link
Contributor Author

@Zakariathr22 Zakariathr22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

I’m not sure if this will impact the NAOT adoption in PR #2095, so it may need verification to ensure there are no runtime issues.

Copy link
Collaborator

@niels9001 niels9001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, works :)! Thanks!

@niels9001 niels9001 enabled auto-merge (squash) February 8, 2026 16:38
@ghost1372
Copy link
Contributor

ghost1372 commented Feb 8, 2026

@niels9001 I should mention that this will increase the size of the program, even in AOT mode it will add 10 ~ 30 MB.
So if the size is not important, it is not important, but if the size is to be mentioned in the shows, I think it is better to think about it, such as removing this sample from the gallery! (Consider a situation where, for example, NAoT reduces the application size by about 30 MB, and then you want to highlight this improvement in conferences or Shows. However, the built-in COM cause the same 30 MB to be added back, so in the end there is no difference in the application size!)

this is my DevWinUI gallery app with and without Built-in COM interop support:

Enabled:
image

Disabled:
image

@Zakariathr22
Copy link
Contributor Author

@niels9001 I should mention that this will increase the size of the program, even in AOT mode it will add 10 ~ 20 MB. So if the size is not important, it is not important, but if the size is to be mentioned in the shows, I think it is better to think about it, such as removing this sample from the gallery!

@marcelwgn I’m very interested in knowing your thoughts on this.

@marcelwgn
Copy link
Contributor

That size increase is quite bad, a non working sample is worse though in my opinion. I think for now, we should enable it since the only other option really is only removing the samples requiring such interactivity. The latter is something we might revisit in the future.

@marcelwgn
Copy link
Contributor

/azp run

@niels9001 niels9001 merged commit 0d26005 into microsoft:main Feb 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Built-in COM disabled via feature switch when loading ContentIsland sample

4 participants