Skip to content

ApiExtensionAttribute not registering extension types #22568

Open

Description

@kazo0

Uno.Sdks tested: 6.4.58, 6.6.0-dev.44

Current behavior

Given a blank or recommended app, using the [ApiExtension] attribute for any type is not generating the global::Uno.Foundation.Extensibility.ApiExtensibility.Register(...) call as part of the generated code for the App.xaml.

Example:

  1. Create a blank Uno app
  2. Define a MyProvider class that implements IWebAuthenticationBrokerProvider
  3. Add the assembly-level attribute: [assembly: Uno.Foundation.Extensibility.ApiExtension(typeof(IWebAuthenticationBrokerProvider), typeof(MyProvider))]
  4. Inspect generated code of the App class for the XamlCodeGenerator. Notice that there is no line anywhere in the generated code that is similar to: global::Uno.Foundation.Extensibility.ApiExtensibility.Register(typeof(global::Uno.AuthenticationBroker.IWebAuthenticationBrokerProvider), o => new MyProvider(o));

Workarounds

You need to manually add the ApiExtensibility.Register(...) call to the App.xaml.cs. Either in the constructor or in OnLaunched.

Repro app

See attached repro app:

UnoApp155.zip

for the repro app, note the first line of the OnLaunched method in App.xaml.cs: ApiExtensibility.Register(typeof(IWebAuthenticationBrokerProvider), _ => new MyProvider());

If you were to comment that line out, the app will crash when pressing on the Click Me button in the MainPage

Activity

  1. added
    triage/untriaged
    difficulty/tbd
    on Feb 4, 2026
  2. added theissue type on Feb 4, 2026
  3. changed the title [-]ApiExtensionAttribute not registering extensions types[/-] [+]ApiExtensionAttribute not registering extension types[/+] on Feb 4, 2026
  4. jeromelaban commented on Feb 4, 2026

    @jeromelaban
    Member

    The registration discovery is currently done on dependents, not on the app assembly itself.

  5. reopened this on Feb 4, 2026
  6. github-actions commented on Jun 5, 2026

    @github-actions
    Contributor

    This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.

  7. added
    stale
    on Jun 5, 2026
  8. removed
    stale
    on Jun 5, 2026
  9. github-actions commented on Oct 4, 2026

    @github-actions
    Contributor

    This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.

  10. added
    stale
    on Oct 4, 2026
  11. removed
    stale
    on Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty/tbdtriage/untriaged

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions