microsoft / microsoft/microsoft-ui-xaml

Published unpackaged, Single File no longer launches in 1.8

Open
#10,876 2 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

I’ve recently updated my project from version 1.7.5 (1.7.251014001) to 1.8.2 (1.8.251003001) and noticed that the published single-file app no longer launched.

The following are repro projects:

[PublishNotLaunch1.7.zip](https://github.com/user-attachments/files/23403651/PublishNotLaunch1.7.zip)

[PublishNotLaunch1.8.zip](https://github.com/user-attachments/files/23403653/PublishNotLaunch1.8.zip)

I got the following message when I try to run the published single file:

`PublishNotLaunch.exe: WinRT originate error - 0x80004005 : ‘Cannot locate resource from ‘ms-appx:///MainWindow.xaml’.’.`

Therefore, I copied ‘MainWindow.xbf” file along with the published single file exe and confirmed the app launched.

It may same reason as [this bug](https://github.com/microsoft/microsoft-ui-xaml/issues/10803), which generated code points wrong resource path might cause this.

I could copy all XBF files to work around this issue, but it would be nice if other way to work around this issue yet still create a single exe file.

Thank you!

### Why is this important?

This issue prevents the project from being updated to version 1.8.

### Steps to reproduce the bug

1. Open [PublishNotLaunch1.8.zip](https://github.com/user-attachments/files/23403653/PublishNotLaunch1.8.zip)
2. Publish the project
3. Run published single exe file (PublishNotLaunch.exe)

### Actual behavior

App doesn't launch

### Expected behavior

App must launch

### Screenshots

_No response_

### NuGet package version

WinUI 3 - Windows App SDK 1.8.2: 1.8.251003001

### Windows version

Windows 11 (24H2): Build 26100

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by opening PublishNotLaunch1.7.zip and PublishNotLaunch1.8.zip, publishing both projects, and comparing their single-file outputs. Inspect the generated resource paths and packaging behavior around MainWindow.xaml and MainWindow.xbf; done means the 1.8 published unpackaged executable launches without copying XBF files beside it.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.