Skip to content

Update hosting support to allow loading in default ALC - #2014

Merged
Manodasan Wignarajah (manodasanW) merged 7 commits into
staging/2.3from
manodasanw/supportdefaultalc
Jul 14, 2025
Merged

Manodasan Wignarajah (manodasanW) merged 7 commits into
staging/2.3from
manodasanw/supportdefaultalc

Conversation

@manodasanW

Copy link
Copy Markdown
Member

Today, we only support loading CsWinRT components in their own ALC to isolate them and their dependencies. But there are scenarios where types from the components being loaded need to be used in the app that is loading it. And in these scenarios, folks run into random errors such as InvalidCastException and MissingMethodException. This allows apps to opt-in to loading CsWinRT components in the default ALC to address this.

Fixes #1277

@Sergio0694 Sergio Pedri (Sergio0694) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems fine. Not a fan of the fact that this change will also set that additional flag for all projects, even though it's actually only needed by the host shim. But I am not sure if we have a better way of doing it? I suppose it also doesn't really hurt anyways, so maybe it doesn't matter.

@manodasanW
Manodasan Wignarajah (manodasanW) merged commit 483d134 into staging/2.3 Jul 14, 2025
@manodasanW
Manodasan Wignarajah (manodasanW) deleted the manodasanw/supportdefaultalc branch July 14, 2025 20:07
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.

2 participants