Repository navigation
Description
Describe the bug
AppNotificationManager.Default.Register() in an unpackaged, self-contained app still throws on Windows App SDK 2.5.1:
System.Runtime.InteropServices.COMException (0x8007007E): The specified module could not be found.
Unable to load resource dll. Microsoft.WindowsAppRuntime.Insights.Resource.dll
at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
at ABI.Microsoft.Windows.AppNotifications.IAppNotificationManagerMethods.Register(IObjectReference _obj)
at Microsoft.Windows.AppNotifications.AppNotificationManager.Register()
This is the failure from #6071. That issue was closed on 2026-09-03 by PR #6725 ("Fix errors from missing resource dll with version info", which also lists #6387), but the released packages do not behave as fixed. Several people on #6071 have reported the same on 2.3.1, 2.4.0 and 2.5.1 since. Filing separately because comments on a closed issue may not reach triage.
What makes this confusing:
- PR Fix errors from missing resource dll with version info #6725's merge commit (
6b178e79) is an ancestor of thev2.5.1tag (git comparesaysv2.5.1is ahead of it;v2.4.0andv2.4.1-expare behind it). Microsoft.WindowsAppSDK.Foundation2.3.12, which 2.5.1 depends on, was published to NuGet on 2026-09-16, after the merge.- In the
v2.5.1source,AppNotificationManager::RegisterUnpackagedAppcallsWindowsAppRuntime::SelfContained::IsSelfContained(), andWindowsAppRuntime_IsSelfContainednow returnsTRUEwhenWindowsAppRuntime_VersionInfo_MSIX_Framework_PackageFamilyName_GetreturnsERROR_MOD_NOT_FOUND. On paper that should stop this exact exception. - Yet
Register()still throws0x8007007E.
I could not find out why. Either the shipped native binary does not contain the fix, or another call site on the Register() path still throws on the missing DLL. I only have the managed stack above, no native stack.
Steps to reproduce the bug
Minimal project, no other code:
Repro.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0-windows10.0.19041.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<WindowsPackageType>None</WindowsPackageType>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<SelfContained>true</SelfContained>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="2.5.1" />
</ItemGroup>
</Project>Program.cs
using System;
using Microsoft.Windows.AppNotifications;
try
{
AppNotificationManager.Default.Register();
Console.WriteLine("Register() succeeded");
}
catch (Exception ex)
{
Console.WriteLine($"Register() threw {ex.GetType().Name} 0x{ex.HResult:X8}: {ex.Message}");
}dotnet publish -c Release -o out
out\Repro.exe
Output on 2.5.1:
Register() threw COMException 0x8007007E: The specified module could not be found.
Unable to load resource dll. Microsoft.WindowsAppRuntime.Insights.Resource.dll
The same project on 2.4.0 fails identically. In our real app (a small helper that shows a notification, self-contained and single-file), I ran 2.4.0 as a control and 2.5.1 side by side and got the same exception from both; the toast itself still displays via Show(), but the activation registration fails, so NotificationInvoked is never raised for button clicks.
The extracted/published output contains Microsoft.WindowsAppRuntime.dll, Microsoft.WindowsAppRuntime.Bootstrap.dll and Microsoft.WindowsAppRuntime.Bootstrap.Net.dll, but no Microsoft.WindowsAppRuntime.Insights.Resource.dll.
Expected behavior
Per the description of #6725, a self-contained app that only uses component packages (no framework/runtime package) should be treated as self-contained when the resource DLL is absent, and Register() should succeed (or at least not throw because of it).
NuGet package version
Microsoft.WindowsAppSDK 2.5.1 (resolved: Foundation 2.3.12, Runtime 2.5.1). Also reproduces on 2.4.0.
Packaging type
Unpackaged
Windows version
Windows 11 25H2 (10.0.26200.9457), x64
IDE
Other (dotnet CLI, .NET SDK 10)
Additional context
- Related: Cannot register AppNotification callback without installing Runtime package for Self-Contained Unpackaged app #6071 (closed), Microsoft.WindowsAppRuntime.Insights.Resource.dll missing from Foundation package #6387, PR Fix errors from missing resource dll with version info #6725.
- Workaround per Cannot register AppNotification callback without installing Runtime package for Self-Contained Unpackaged app #6071: install the Windows App SDK Runtime (defeats the purpose of self-contained), or catch the exception and accept that activation callbacks will not be delivered.
- The system locale is Swedish; the
Det går inte att hitta den angivna modulentext in raw logs is the localized form of the message above.
Activity
Port queue notifications to the Swift and C# apps
Phase 2a: phone notifications on the PC, tray and start with Windows
Add notifications, with a test one in the tray menu
build: restore the Windows App Runtime insights resource for toasts
Spike S3: unpackaged WinUI 3 with Velopack and answerable toasts (#3)
sicil1ano commentedon Oct 29, 2026
How is this issue not fixed yet?
When will the fix be released?
fix(notifications): ship the Insights resource Register needs, and sa…
feat: the HUD (#16)
Port queue notifications to the Swift and C# apps
Клиент на .NET 11 и MAUI 11