From c74419b333423cc0cefeeb5a16c04a965fbca019 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 16 Apr 2026 10:19:16 +0200 Subject: [PATCH 1/2] Fix trimmed library test assemblies missing from app bundles PR #125673 changed Microsoft.NET.ILLink.targets to skip creating the TrimmerRootAssembly item for Library-output projects. The RootEntireIntermediateAssembly target in tests.mobile.targets relied on that item existing so it could update its RootMode metadata from EntryPoint to 'all'. Since the item no longer exists for Library projects, the metadata update is a no-op and the test assembly is left unrooted. ILLink then trims it entirely, causing all Release library tests on tvOS (both CoreCLR and Mono) to fail with: 'Test libs were not found (*.Tests.dll was not found in ...)' Fix by using Remove+Include to unconditionally create the TrimmerRootAssembly item with RootMode='all', regardless of whether the SDK already created one. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/testing/tests.mobile.targets | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 21b85c60da72e3..f460de543a65fc 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -46,13 +46,13 @@ + The SDK no longer creates a TrimmerRootAssembly item for Library projects (see + Microsoft.NET.ILLink.targets), so update the metadata if the item exists and + add it outright when it does not. --> - - all - + + From 2f0e54ee3e890213d550496a0d784b2b0da9ba56 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 17 Apr 2026 08:52:05 +0200 Subject: [PATCH 2/2] Address review: reword RootEntireIntermediateAssembly comment Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/testing/tests.mobile.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index f460de543a65fc..d38673115d6aa4 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -47,8 +47,8 @@ + Microsoft.NET.ILLink.targets), so replace any existing item and create it when + absent to ensure RootMode="all". -->