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

Root ComActivator for hosting #54524

Merged
merged 2 commits into from
Jun 23, 2021
Merged

Root ComActivator for hosting #54524

merged 2 commits into from
Jun 23, 2021

Conversation

LakshanF
Copy link
Member

ComActivator is a special type for the following reasons

  • Its a COM helper class: We have guards on public methods (we throw NotSupportedException if built-in COM is disabled)
  • Its referred in hostpolicy

The above means that we trim the whole type away in the following scenarios and will give a less than ideal experience for callers from native code.

  • The application code does not refer to it
  • Built-in COM is disabled (default for net core applications)

This change will root the type globally (not under a feature switch) similar to other native hosts (EnableCppCLIHostActivation, _EnableConsumingManagedCodeFromNativeHosting) so that the type will always be there. If BuiltInComInteropSupport is disabled, we will only have the throw code and users from the native side will get an error that gives more information (built-in COM is disabled and a url link)

Fixes #43606

@ghost ghost added the linkable-framework Issues associated with delivering a linker friendly framework label Jun 21, 2021
@ghost ghost added the linkable-framework Issues associated with delivering a linker friendly framework label Jun 21, 2021
@ghost
Copy link

ghost commented Jun 21, 2021

Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr
See info in area-owners.md if you want to be subscribed.

Issue Details

ComActivator is a special type for the following reasons

  • Its a COM helper class: We have guards on public methods (we throw NotSupportedException if built-in COM is disabled)
  • Its referred in hostpolicy

The above means that we trim the whole type away in the following scenarios and will give a less than ideal experience for callers from native code.

  • The application code does not refer to it
  • Built-in COM is disabled (default for net core applications)

This change will root the type globally (not under a feature switch) similar to other native hosts (EnableCppCLIHostActivation, _EnableConsumingManagedCodeFromNativeHosting) so that the type will always be there. If BuiltInComInteropSupport is disabled, we will only have the throw code and users from the native side will get an error that gives more information (built-in COM is disabled and a url link)

Fixes #43606

Author: LakshanF
Assignees: -
Labels:

area-Interop-coreclr, linkable-framework

Milestone: -

@LakshanF LakshanF merged commit 56b3751 into dotnet:main Jun 23, 2021
@LakshanF LakshanF deleted the ComActivator branch June 23, 2021 12:11
thaystg added a commit to thaystg/runtime that referenced this pull request Jun 23, 2021
…nitial_config

* origin/main: (362 commits)
  [wasm][debugger] Reuse debugger-agent on wasm debugger (dotnet#52300)
  Put Crossgen2 in sync with dotnet#54235 (dotnet#54438)
  Move System.Object serialization to ObjectConverter (dotnet#54436)
  Move setting fHasVirtualStaticMethods out of sanity check section (dotnet#54574)
  [wasm] Compile .bc->.o in parallel, before passing to the linker (dotnet#54053)
  Change PathInternal.IsCaseSensitive to a constant (dotnet#54340)
  Make mono_polling_required a public symbol (dotnet#54592)
  Respect EventSource::IsSupported setting in more codepaths (dotnet#51977)
  Root ComActivator for hosting (dotnet#54524)
  Add ILLink annotations to S.D.Common related to DbConnectionStringBuilder (dotnet#54280)
  Fix finalizer issue with regions (dotnet#54550)
  Add support for multi-arch install locations (dotnet#53763)
  Update library testing docs page to reduce confusion (dotnet#54324)
  [FileStream] handle UNC and device paths (dotnet#54483)
  Update NetAnalyzers version (dotnet#54511)
  Added runtime dependency to fix the intermittent test failures (dotnet#54587)
  Disable failing System.Reflection.Tests.ModuleTests.GetMethods (dotnet#54564)
  [wasm] Move AOT builds from `runtime-staging` to `runtime` (dotnet#54577)
  Keep obj node for ArrayIndex. (dotnet#54584)
  Disable another failing MemoryCache test (dotnet#54578)
  ...
@ghost ghost locked as resolved and limited conversation to collaborators Jul 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Interop-coreclr linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ComActivator will always be removed by trimming
4 participants