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
- Download and extract this project: App1.zip
- Hit F5 / Run
- Observe exception
- Change the
<RuntimeIdentifier>win10-x86</RuntimeIdentifier> to be win10-x64
- Hit F5 / Run
- 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

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
Describe the bug
I have a single project app that crashes on launch with a
BadImageFormatException:Steps to reproduce the bug
<RuntimeIdentifier>win10-x86</RuntimeIdentifier>to bewin10-x64I 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
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