microsoft / microsoft/aspire

[Aspire.Hosting.MAUI][Windows] Unable to start Windows app if WindowsPackageType is MSIX

Open
#12,941 0 comments 2 reactions 0 assignees View on GitHub
needs-area-label
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

Exception thrown when running MAUI App for windows via the app host, if WindowsPackageType is set to MSIX

# WindowsPackageType is None

Image

# WindowsPackageType is MSIX

Image

Image

Interestingly, Aspire thinks the app is still running even though it has thrown.

### Expected Behavior

Aspire should be able to run on a Windows device even if WindowsPackageType is MSIX

### Steps To Reproduce

1. Download the following zip

[MAUIAspire.Sample.zip](https://github.com/user-attachments/files/23510532/MAUIAspire.Sample.zip)
2. Run the Aspire app host
3. Whilst testing, try switching between WindowsPackageVersion None and WindowsPackageVersion MSIX in the MAUIApp.csproj to test the bug. Should throw on MSIX should run fine on None

### Exceptions (if any)

MAUIApp exception
```
Executing command 'resource-start'.
Successfully executed command 'resource-start'.
Unhandled exception. System.Runtime.InteropServices.COMException (0x80040154): Class not registered (0x80040154 (REGDB_E_CLASSNOTREG))
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
at WinRT.ActivationFactory.Get(String typeName)
at Microsoft.Windows.ApplicationModel.WindowsAppRuntime.DeploymentInitializeOptions.get__objRef_global__Microsoft_Windows_ApplicationModel_WindowsAppRuntime_DeploymentInitializeOptions()
at Microsoft.Windows.ApplicationModel.WindowsAppRuntime.DeploymentInitializeOptions..ctor()
at Microsoft.Windows.ApplicationModel.WindowsAppRuntime.DeploymentManagerCS.AutoInitialize.get_Options() in P:\packages\nuget\microsoft.windowsappsdk\1.7.250909003\include\DeploymentManagerAutoInitializer.cs:line 44
at Microsoft.Windows.ApplicationModel.WindowsAppRuntime.DeploymentManagerCS.AutoInitialize.AccessWindowsAppSDK() in P:\packages\nuget\microsoft.windowsappsdk\1.7.250909003\include\DeploymentManagerAutoInitializer.cs:line 30
at Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Common.AutoInitialize.InitializeWindowsAppSDK() in P:\packages\nuget\microsoft.windowsappsdk\1.7.250909003\include\WindowsAppRuntimeAutoInitializer.cs:line 22
at .cctor()
```

### .NET Version info

```
.NET SDK:
Version: 10.0.100
Commit: b0f34d51fc
Workload version: 10.0.100.1
MSBuild version: 18.0.2+b0f34d51f

Runtime Environment:
OS Name: Windows
OS Version: 10.0.26200
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.100\

.NET workloads installed:
[android]
Installation Source: SDK 10.0.100, VS 18.0.11205.157
Manifest Version: 36.1.2/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.android\36.1.2\WorkloadManifest.json
Install Type: Msi

[ios]
Installation Source: SDK 10.0.100, VS 18.0.11205.157
Manifest Version: 26.1.10494/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.ios\26.1.10494\WorkloadManifest.json
Install Type: Msi

[maccatalyst]
Installation Source: SDK 10.0.100, VS 18.0.11205.157
Manifest Version: 26.1.10494/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.maccatalyst\26.1.10494\WorkloadManifest.json
Install Type: Msi

[maui]
Installation Source: SDK 10.0.100
Manifest Version: 10.0.0/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.maui\10.0.0\WorkloadManifest.json
Install Type: Msi

[maui-windows]
Installation Source: SDK 10.0.100, VS 18.0.11205.157
Manifest Version: 10.0.0/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.maui\10.0.0\WorkloadManifest.json
Install Type: Msi

[wasm-tools]
Installation Source: SDK 10.0.100, VS 18.0.11205.157
Manifest Version: 10.0.100/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.workload.mono.toolchain.current\10.0.100\WorkloadManifest.json
Install Type: Msi

[wasm-tools-net9]
Installation Source: SDK 10.0.100, VS 18.0.11205.157
Manifest Version: 10.0.100/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.workload.mono.toolchain.net9\10.0.100\WorkloadManifest.json
Install Type: Msi

Configured to use workload sets when installing new manifests.

Host:
Version: 10.0.0
Architecture: x64
Commit: b0f34d51fc

.NET SDKs installed:
8.0.416 [C:\Program Files\dotnet\sdk]
9.0.306 [C:\Program Files\dotnet\sdk]
10.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download
```

### Anything else?

# Package Versions
- Aspire 13.0
- MAUI 10.0.10
- Aspire.Hosting.Maui 13.0.0-preview.1.25560.3

# IDE
- Visual Studio Community 2026 (18.0)

# Temporary workaround in MAUIApp.csproj
```xml

None

MSIX

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.