Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrepancy in Windows built-in COM support between native and managed sides #56222

Open
LakshanF opened this issue Jul 23, 2021 · 0 comments
Open

Comments

@LakshanF
Copy link
Member

.NET has the ability to disable interop support in Windows for built-in COM via a feature switch in .NET6. However, there is an observable behavioral difference mismatch in native and managed side when built-in COM is disabled. This is primarily due to the native side lacking dynamic checks in Windows native code. There is a static configuration flag, FEATURE_COMINTEROP, that is used in non-Windows platforms that is effective in those platforms (since the code is removed in those builds) but can cause problems in Windows when built-in COM is disabled. Issue #55600 highlights a way this can be bubbled up.

Although this feature switch originated from Trimming requirements and the behavioral differences can be flushed out currently via trimmed applications (trimmer removes types and members from managed side that native side depend on), this discrepancy exist independent of trimming. It will be good to treat it as such and ensure that the differences are addressed. Native side has a flag, IsBuiltInCOMSupported(), that can be leveraged for dynamic checking.

Some options that could be leveraged (from a discussion with @vitek-karas) for this;

  1. CR of the native side where built-in COM is used (The configuration flag, FEATURE_COMINTEROP, guards these places statically currently). The downsides are that this code is spread in many locations and risks with future changes
  2. Add a testing mode to leverage existing test bed (add an assert for code guarded by FEATURE_COMINTEROP)
@LakshanF LakshanF added this to the 7.0.0 milestone Jul 23, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added area-Interop-coreclr untriaged New issue has not been triaged by the area owner labels Jul 23, 2021
@LakshanF LakshanF removed the untriaged New issue has not been triaged by the area owner label Jul 23, 2021
@AaronRobinsonMSFT AaronRobinsonMSFT modified the milestones: 7.0.0, 8.0.0 Aug 5, 2022
@jkoritzinsky jkoritzinsky modified the milestones: 8.0.0, 9.0.0 Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants