Skip to content

WinUI 3 Single Project MSIX crashes when built for x86 #2064

@mattleibow

Description

@mattleibow

Describe the bug

I have a single project app that crashes on launch with a BadImageFormatException:

System.BadImageFormatException: 'An attempt was made to load a program with an incorrect format. (0x8007000B)'
This exception was originally thrown at this call stack:
    App1.Program.Main(string[]) in App.g.i.cs

Steps to reproduce the bug

  1. Download and extract this project: App1.zip
  2. Hit F5 / Run
  3. Observe exception
  4. Change the <RuntimeIdentifier>win10-x86</RuntimeIdentifier> to be win10-x64
  5. Hit F5 / Run
  6. Observe NO exception

I created this by making a new WinUI 3 app, converted it to a single project and then make the app be an AnyCPU with a x86 RID.

Expected behavior

No crash - like win10-x64.

Screenshots

image

NuGet package version

1.0.0

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 21H2 (22000)

IDE

Visual Studio 2022-preview

Additional context

No response

AzDo bug: https://dev.azure.com/microsoft/OS/_workitems/edit/38094973

Metadata

Metadata

Assignees

Labels

area-DeveloperToolsIssues related to authoring (source and IDL), debugging, HotReload, LiveVisualTree, VS integrationbugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions