microsoft / microsoft/WindowsAppSDK

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

Open
#6,774 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

needs-triage
Dominant language
C++
Stars
4.7k
Forks
471
Avg merge
3d 13h
Merged PRs (30d)
28

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 #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`
```xml


Exe
net10.0-windows10.0.19041.0
win-x64
None
true
true



```

`Program.cs`
```csharp
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: #6071 (closed), #6387, PR #6725.
- Workaround per #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 modulen` text in raw logs is the localized form of the message above.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the native RegisterUnpackagedApp path and its call to WindowsAppRuntime::SelfContained::IsSelfContained, then reproduce using Repro.csproj and Program.cs with the 2.5.1 package. Trace which call still loads Microsoft.WindowsAppRuntime.Insights.Resource.dll and compare the published native binaries with the source. Done means Register() no longer throws 0x8007007E in the self-contained unpackaged reproduction and activation callbacks remain available.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, csharp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.