Skip to content

StackOverflow in <BindableTypeLinkerGeneratorTask*/> on "recursive" types #23147

Closed

Description

@jonpryor

Current behavior 🐛

Consider the following type hierarchy:

public class SomeInfo<T>
{
}

public class MyInfo : SomeInfo<MyInfo>
{
}

If MyInfo is used by a property on a [Bindable] type:

[Microsoft.UI.Xaml.Data.Bindable]
public partial class SampleChooserCategory
{
	public MyInfo MyInfo => null;
}

and the app is built for Native AOT / with $(PublishAot)=true -- which causes the <BindableTypeLinkerGeneratorTask*/> task to execute -- then the build fails with an MSB4217:

> dotnet publish App.csproj -r android-arm64 -f net10.0-android -p:PublishAot=true -bl
…
…\.nuget\packages\uno.winui\6.6.0-dev.1285\buildTransitive\Uno.UI.Tasks.targets(483,3): error MSB4217: Task host node exited prematurely. Diagnostic information may be found in files in the temporary files directory named MSBuild_*.failure.txt.

(There are no MSBuild_*.failure.txt files in the "temporary files directory"…)

Expected behavior 🎯

No MSB4217 / no crash within <BindableTypeLinkerGeneratorTask*/>.

How to reproduce it (as minimally and precisely as possible) 🔬

Within unoplatform/uno, apply the following patch:

diff --git a/src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Controls/SampleChooserCategory.cs b/src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Controls/SampleChooserCategory.cs
index ce76194df4..46e004d352 100644
--- a/src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Controls/SampleChooserCategory.cs
+++ b/src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Controls/SampleChooserCategory.cs
@@ -30,6 +30,8 @@ namespace SampleControl.Entities
 
 		public int Count => SamplesContent.Count;
 
+		public MyInfo MyInfo => null;
+
 		public override bool Equals(object obj) =>
 			obj switch
 			{
@@ -75,4 +77,12 @@ namespace SampleControl.Entities
 
 		public static bool operator >=(SampleChooserCategory left, SampleChooserCategory right) => left.CompareTo(right) >= 0;
 	}
+
+	public class SomeInfo<T>
+	{
+	}
+
+	public class MyInfo : SomeInfo<MyInfo>
+	{
+	}
 }

Build it for Android + Native AOT:

dotnet publish src/SamplesApp/SamplesApp.Skia.netcoremobile/SamplesApp.Skia.netcoremobile.csproj -r android-arm64 -f net10.0-android -p:UnoTargetFrameworkOverride=net10.0-android -p:ApplicationId=uno.platform.samplesapp.skia.nativeaot -p:SkiaPublishAot=true -p:SkiaSharpVersion=3.119.2-preview.1 -bl

Build fails with an MSB4217.

Workaround 🛠️

No response

Renderer 🎨

  • Skia
  • Native

Affected platforms 📱💻🖥️

All platforms 🌍

Uno.Sdk version (and other relevant versions) 📦

Uno.Sdk 6.6.0-dev.194 (among others).

IDE version 🧑‍💻

No response

Anything else we need to know? 💬

No response

Activity

  1. added
    triage/untriaged
    on Apr 28, 2026
  2. added theissue type on Apr 28, 2026
  3. removed
    triage/untriaged
    on Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions