#24552·uno

[Skia/macOS] TokenizingTextBox crashes with TypeLoadException: incompatible GetChildrenCore return type

Author: TopperDELCreated Sep 18, 2026Updated Sep 18, 2026

Current behavior

Opening an email editor containing CommunityToolkit.WinUI.Controls.TokenizingTextBox crashes on macOS with the Skia desktop target.

The exception occurs while the control is being constructed during InitializeComponent(). Skia accessibility requests an automation peer, and the runtime cannot load TokenizingTextBoxAutomationPeer because its GetChildrenCore() return type is incompatible with the base method.

Expected behavior

The control should be created successfully, and its automation peer should work with the Uno version used by the application.

Environment

  • Uno.Sdk: 6.6.42 (the SDK version from the application's global.json; not necessarily the resolved Uno.WinUI package version)
  • CommunityToolkit.WinUI.Controls.TokenizingTextBox: 8.2.251219
  • Target framework: net10.0-desktop
  • Platform: macOS, Skia desktop
  • Configuration in the supplied stack trace: Debug
  • The assembly reports version 8.2.0.0 in the exception.
  • Exact macOS version and resolved Uno.WinUI version: not yet collected.

Reproduction

Observed in an existing application when opening an editor with TokenizingTextBox controls for To, CC, and BCC.

A suggested minimal reproduction is an Uno desktop application using the versions above, with a page containing:

xml
<Page
    x:Class="Repro.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:toolkit="using:CommunityToolkit.WinUI.Controls">
    <toolkit:TokenizingTextBox TokenDelimiter="," />
</Page>

Run on macOS and open the page.

This standalone minimal sample has not yet been run; the stack trace below is from the actual application.

Exception and stack trace

System.TypeLoadException:
Return type in method
'CommunityToolkit.WinUI.Automation.Peers.TokenizingTextBoxAutomationPeer.GetChildrenCore()'
on type
'CommunityToolkit.WinUI.Automation.Peers.TokenizingTextBoxAutomationPeer'
from assembly
'CommunityToolkit.WinUI.Controls.TokenizingTextBox, Version=8.2.0.0, Culture=neutral, PublicKeyToken=null'
is not compatible with base type method
'Microsoft.UI.Xaml.Automation.Peers.ListViewBaseAutomationPeer.GetChildrenCore()'.

   at CommunityToolkit.WinUI.Controls.TokenizingTextBox.OnCreateAutomationPeer()
   at Microsoft.UI.Xaml.UIElement.OnCreateAutomationPeerInternal()
   at Microsoft.UI.Xaml.UIElement.GetOrCreateAutomationPeer()
   at Uno.UI.Runtime.Skia.SkiaAccessibilityBase.IsAccessibilityFocusable(DependencyObject dependencyObject, Boolean isFocusable)
   at Microsoft.UI.Xaml.Controls.Control.OnIsFocusableChanged()
   at Microsoft.UI.Xaml.Controls.Control..ctor()
   at Microsoft.UI.Xaml.Controls.ItemsControl..ctor()
   at Microsoft.UI.Xaml.Controls.Primitives.Selector..ctor()
   at Microsoft.UI.Xaml.Controls.ListViewBase..ctor()
   at CommunityToolkit.WinUI.Controls.TokenizingTextBox..ctor()
   at Treesy.Controls.Editors.EMailTrunkEditor.InitializeComponent()
      in Planter/Planter/obj/Debug/net10.0-desktop/Uno.UI.SourceGenerators/Uno.UI.SourceGenerators.XamlGenerator.XamlCodeGenerator/EMailTrunkEditor_a5894c01aa3e692fe448ef8b1fb658c9.cs:line 57
   at Treesy.Controls.Editors.EMailTrunkEditor..ctor(
      IEMailAddressVerifierService eMailAddressVerifierService,
      IEventAggregator eventAggregator,
      IDropService dropService,
      IAppConnector appConnector)

The local absolute path was shortened above.

Source investigation

The following return-type mismatch appears consistent with the exception:

  • Toolkit TokenizingTextBoxAutomationPeer.GetChildrenCore() returns IList<AutomationPeer>.
  • Uno ListViewBaseAutomationPeer.GetChildrenCore() returns List<AutomationPeer>.

The mismatch is also visible in these published source versions:

The newer versions above were inspected at source level only; the application has not been tested with that newer combination.

Could you confirm whether this is a binary compatibility issue in Uno's automation peer API, and whether the fix should be made in Uno or coordinated with the Windows Community Toolkit?

Workaround

No verified workaround yet. One possible application-level workaround would be to derive from TokenizingTextBox and override OnCreateAutomationPeer() to return a compatible custom peer compiled against the application's Uno version, without instantiating the incompatible Toolkit peer. This has not yet been implemented or tested.