dotnet / dotnet/maui

Failed to Make MSIX Package when using NativeAOT

Open
#35,641 1 comment 2 reactions 0 assignees View on GitHub
area-tooling platform/windows s/triaged s/verified t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 15h
Merged PRs (30d)
290

Description

### Description

I created a demo MAUI project with TargetFramework `net10.0-windows10.0.26100.0`, and tried to publish the project with command below
```
dotnet publish -f net10.0-windows10.0.26100.0 -r win-x64 -p:PublishAot=true -p:WindowsPackageType=MSIX -p:WindowsAppSDKSelfContained=true
```

The compilation succeeded, the executable file coule be found at `bin/Release/net10.0-windows10.0.26100.0/win-x64/publish/TestMaui.exe` and works well

But errors occurred when making MSIX package
```
MakeAppx : error Manifest validation error: Line 25, Column 27, Reason: The file name "TestMaui.exe" declared for element "*[local-name()='Applications']/*[local-name()='Application']" doesn't exist in the package.
MakeAppx : error Package creation failed.
MakeAppx : error 0x80080204 - The specified package format is not valid: The package manifest is not valid.
```

I also tried to follow the [official documentation](https://learn.microsoft.com/en-us/dotnet/maui/windows/deployment/publish-cli), using `-p:RuntimeIdentifierOverride=win-x64` instead of `-r win-x64`, but packing failed too.

I've tried these versions
+ MAUI: `10.0.20` `10.0.60` `10.0.70`
+ Windows SDK: `10.0.26100.0`
+ Windows App SDK: `1.7` `1.8` `2.0` `2.1`
+ Windows SDK BuildTools: `10.0.26100` `10.0.28000`

Seems like the package process doesn't use publish files?

### Steps to Reproduce

_No response_

### Link to public reproduction project repository

_No response_

### Version with bug

10.0.70

### Is this a regression from previous behavior?

Not sure, did not test other versions

### Last version that worked well

Unknown/Other

### Affected platforms

Windows

### Affected platform versions

Windows SDK 10.0.26100.0

### Did you find any workaround?

_No response_

### Relevant log output

```shell

```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported dotnet publish command for the MAUI project targeting net10.0-windows10.0.26100.0 with NativeAOT and MSIX enabled. Compare the generated package manifest's TestMaui.exe entry with the files under the publish directory; done means MakeAppx can create a valid package containing the executable.

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
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.