Skip to content

AppNotificationManager.Register() still throws 0x8007007E (missing Microsoft.WindowsAppRuntime.Insights.Resource.dll) in self-contained unpackaged apps on 2.5.1; #6071 closed by #6725 but not fixed #6774

Description

@GenerAhl

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 the v2.5.1 tag (git compare says v2.5.1 is ahead of it; v2.4.0 and v2.4.1-exp are behind it).
  • Microsoft.WindowsAppSDK.Foundation 2.3.12, which 2.5.1 depends on, was published to NuGet on 2026-09-16, after the merge.
  • In the v2.5.1 source, AppNotificationManager::RegisterUnpackagedApp calls WindowsAppRuntime::SelfContained::IsSelfContained(), and WindowsAppRuntime_IsSelfContained now returns TRUE when WindowsAppRuntime_VersionInfo_MSIX_Framework_PackageFamilyName_Get returns ERROR_MOD_NOT_FOUND. On paper that should stop this exact exception.
  • Yet Register() still throws 0x8007007E.

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Status: Pending releaseThe issue has been fixed but has not yet shipped in a release.area-NotificationsToast notification, badges, Live Tiles, push notificationsarea-SelfContainedIssues related to (Windows App SDK) self-contained apps

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions