microsoft-ui-xaml: App will be Crash with an InfoBar and Publish as Single File Option
Describe 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
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (17 by maintainers)
Windows App SDK 1.5 now supports PublishSingleFile: https://www.nuget.org/packages/Microsoft.WindowsAppSDK/1.5.240227000
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.
SDK 1.4 - My apps crash with InfoBar, even when not using the “Single File Option”
@ghost1372 No updates - hopefully soon. Thanks for your patience.
I’m having the same issue. As soon as a I run the app as “Single File” the app crashed when opening a Window or a Page that has an InfoBar (doesn’t matter if that InfoBar is created in C# code or with XAML).
Thanks @riverar, and @ghost1372 I will transfer this to the WinUI3 repository so the automated system clone it in our internal Azure DevOps and we can triage and prioritize it.