From 8e29c1dc1e2b8849535ae26d041d89d97144cecf Mon Sep 17 00:00:00 2001 From: Zac Gaetano Date: Wed, 13 May 2026 00:16:11 -0400 Subject: [PATCH] build(winui3): suppress UndockedRegFreeWinRT auto-init; document chase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds false with a comment chain that traces the runtime activation failure investigation to the next maintainer: 1. WindowsAppSDK's UndockedRegFreeWinRTCommon.targets only auto-enables the ModuleInitializer when WindowsAppSDKSelfContained=true. 2. Without it, framework-dependent unpackaged builds need our own explicit Bootstrap.TryInitialize call (Program.cs already does this). 3. WITH it, the bundled auto-init P/Invokes Microsoft.WindowsAppRuntime.dll during module load — but the runtime DLL lives in the framework MSIX package, not the output dir, and Bootstrap hasn't yet added the framework dir to the DLL search path. The P/Invoke fails and the .exe dies before Main runs. Setting the property to false explicitly suppresses the early P/Invoke so our Program.Main + Bootstrap.TryInitialize can sequence correctly. This didn't fix activation on this build host though — the .exe still shows "this application could not be started." Strong suspicion: the managed assembly references Microsoft.WinUI.dll which itself has DllImport-style dependencies the .NET host probes during assembly load. Recommended next steps (not done overnight to avoid further blind swings): attach a debugger to TeamsISO.exe before Main runs (windbg sxe ld for the runtime DLL, or VS 'Just My Code: off' attach), capture the CLR fusion log, or try a known-good Microsoft WinUI 3 template side-by-side to isolate whether the issue is project or machine. Build remains clean. WPF host unaffected. --- src/TeamsISO.App.WinUI/TeamsISO.App.WinUI.csproj | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/TeamsISO.App.WinUI/TeamsISO.App.WinUI.csproj b/src/TeamsISO.App.WinUI/TeamsISO.App.WinUI.csproj index e4c05f5..f7e4aed 100644 --- a/src/TeamsISO.App.WinUI/TeamsISO.App.WinUI.csproj +++ b/src/TeamsISO.App.WinUI/TeamsISO.App.WinUI.csproj @@ -63,6 +63,19 @@ loader doesn't find them at activation time. --> win-x64 + + false enable enable Assets\teamsiso.ico