Skip to content

Conversation

@manodasanW
Copy link
Member

@manodasanW manodasanW commented Feb 24, 2025

Today, we support overriding the runtime class name returned for IInspectable via the WinRTRuntimeClassName attribute. But if someone asks for the activation factory with that name, it fails. This enables an activation factory being generating with those runtime class names when CsWinRTGenerateOverridedClassNameActivationFactory is set. This is enabled via the generated projection also calling an partial implementation of the activation factory when partial_factory is set which allows the source generator side to implement the activation factory with remapped names.

We also now generate Module.GetActivationFactory when activation factories are merged in a non cswinrt component project. This allows the JIT scenario to be simlar to the AOT scenario which had DllGetActivationFactory generated and thereby be able to be activated via WinRT.Host.

Also fixed the issue with help not displaying by increasing the buffer size.

Fixes #1929
Fixes #1872

Copy link
Member

@Sergio0694 Sergio0694 left a comment

Choose a reason for hiding this comment

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

Looks good! I assume the new method will just be trimmed anyway when publishing with NAOT and merging activation factories, so I don't expect any binary size diffs.

@manodasanW
Copy link
Member Author

Looks good! I assume the new method will just be trimmed anyway when publishing with NAOT and merging activation factories, so I don't expect any binary size diffs.

Right, I expect it to be trimmed away. I was debating making DllGetActivationFactory call this function but then didn't just to avoid indrection which was going to do the same thing and it also allows it to be trimmed away.

@manodasanW manodasanW merged commit 7112302 into master Feb 24, 2025
10 checks passed
@manodasanW manodasanW deleted the manodasanw/runtimeclassnameactivation branch February 24, 2025 21:19
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.

Bug: When using WinRTRuntimeClassName attribute, we should be able to also activate that type using that name Bug: Command Line Help Prints Nothing

3 participants