microsoft / microsoft/microsoft-ui-xaml

Published unpackaged app in Single File does not execute

Open
#10,173 13 comments 4 reactions 0 assignees View on GitHub
area-Unpackaged bug team-Markup
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

Publishing an unpackaged application with it being a `Single File` makes the executable not being able to launch...
Publishing it without it being `Single File` works correctly and it launches fine.
Trimming and ReadyToRun have no change on whether the single file works or not.

### Steps to reproduce the bug

1. Create new project
2. Open .csproj file and add:
```xml
None
true
```

3. Make a new profile (debug / release doesn't matter)
Target framework: net8.0-windows10.0.19041.0
Deployment mode: self-contained
Target runtime: win-x64
File publish options: Check Produce single file, the rest don't matter

4. Publish (it will build correctly) but opening the executable does not work.

### Expected behavior

The executable to launch correctly.

### Screenshots

_No response_

### NuGet package version

WinUI 3 - Windows App SDK 1.6.2: 1.6.241106002

### Windows version

_No response_

### Additional context

Windows version is: 23H2 (for some reason it wasn't an option in the select dropdown)
VS2022 version: 17.12.0
dotnet sdk: 8.0.404

Project is attached:
[project.zip](https://github.com/user-attachments/files/17784478/project.zip)
(edit: had to reupload the project.zip because it didn't include the publish profile)

Contributor guide

Open the contributing guide

Research direction

Start with the attached project.zip, including its .csproj and publish profile, and reproduce the self-contained win-x64 Single File publish described in the issue. Compare the generated executable with a publish that does not use Single File, using the listed Windows App SDK, Visual Studio, and .NET SDK versions. Done means the unpackaged Single File executable launches successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.