Skip to content

Bug: Enable configuration for activation fallback #1436

@jonwis

Description

@jonwis

Version

2.0.220131.2

Summary

winrt::impl::get_runtime_activation_factory_impl does the following:

  1. If the DLL has set a handler callback, call it and return.
  2. Try to use Windows' RoGetActivationFactory, if present, and the type's factory is available, return it.
  3. Do type-name based probing (Contoso.Foo.Bar.dll, Contoso.Foo.dll, Contoso.dll) for DLLs and use those

Certain projects really only want items 1 & 2 above. Provide a control point for 3. Path based probing can induce surprise behavior when DLLs have overlapping names.

Reproducible example

No response

Expected behavior

No response

Actual behavior

No response

Additional comments

After talking with @oldnewthing , I suggest:

  • Move the name-based probing to a new method, like winrt::find_dll_factory
  • Change get_runtime_activation_factory_impl to use a callback pointer, like winrt_fallback_handler
  • Document how to say winrt_activation_handler = winrt::fallback_handler if your module needs fallback

This makes the default behavior "you have to get your stuff registered in a side-by-side or package manifest, or you have to be using a built-in or Windows type" with support for projects who prefer reg-free operation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions