App will be Crash with an InfoBar and Publish as Single File Option
See original GitHub issueDescribe the bug
If we have an InfoBar in MainWindow and publish it as a Single File (PublishSingleFile = true) App will not run and will crash.
Steps to reproduce the bug
1.Create a New WinUI 3 Project 2.Change To Unpackaged Project <WindowsPackageType>None</WindowsPackageType> 3. Add InfoBar on MainWindow
<Window
x:Class="App1.MainWindow">
<StackPanel>
<InfoBar
Title="Up To Date"
IsClosable="False"
IsOpen="True"
Severity="Success" />
</StackPanel>
</Window>
- Publish Project as Single File (PublishSingleFile = true)
- Run Published App
Expected behavior
App should run without any problems
Screenshots
No response
NuGet package version
1.0.0
Packaging type
Unpackaged
Windows version
Windows 11 version 21H2 (22000)
IDE
Visual Studio 2022
Additional context
No response
Issue Analytics
- State:
- Created a year ago
- Comments:17 (15 by maintainers)
Top Results From Across the Web
App will be Crash with an InfoBar and Publish as Single ...
If we have an InfoBar in MainWindow and publish it as a Single File (PublishSingleFile = true) App will not run and will...
Read more >Welcome to Hell - Windows Publishing with .NET MAUI
NET MAUI app as a single file for Windows, please let me know. ... App will be Crash with an InfoBar and Publish...
Read more >Create a single file for application deployment - .NET
The single file deployment option can be combined with ReadyToRun ... Publish a single file application using the dotnet publish command.
Read more >.Net 5 Self-contained single file deployment of default ...
Create a new project using Winforms App .Net C# template. Publish as single file self-contained deployment. App fails to start (or gives an...
Read more >A published single-file app crashes on startup under ...
A published single-file app crashes on startup under Windows 7 (.NET 5.0, self-contained). CS CS.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Can confirm @ghost1372. Appears to be a WinUI issue but I don’t blame you for posting it here since that repository is more/less dead. Maybe @gabbybilka or @marb2000 can help route.
Related: microsoft/microsoft-ui-xaml#6400, microsoft/microsoft-ui-xaml#7063, microsoft/microsoft-ui-xaml#6757, etc.
Best guidance for you right now is to completely avoid using Single File publishing for all WinUI/WinAppSDK work.
@ghost1372 No updates - hopefully soon. Thanks for your patience.