Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App will be Crash with an InfoBar and Publish as Single File Option #7143

Closed
ghost1372 opened this issue Apr 4, 2022 · 21 comments
Closed

App will be Crash with an InfoBar and Publish as Single File Option #7143

ghost1372 opened this issue Apr 4, 2022 · 21 comments
Assignees
Labels
area-InfoBar bug Something isn't working Crash whenever user reports a crash or app freeze needs-triage Issue needs to be triaged by the area owners product-winui3 WinUI 3 issues team-Markup Issue for the Markup team

Comments

@ghost1372
Copy link
Contributor

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
None
3. Add InfoBar on MainWindow

<Window
    x:Class="App1.MainWindow">
    <StackPanel>
        <InfoBar
                        Title="Up To Date"
                        IsClosable="False"
                        IsOpen="True"
                        Severity="Success" />
    </StackPanel>
</Window>
  1. Publish Project as Single File (PublishSingleFile = true)
  2. 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

@ghost1372
Copy link
Contributor Author

ghost1372 commented Apr 17, 2022

Hi @jonwis , @DrusTheAxe
Can you track this? Should we report this issue in winui repo?

@DrusTheAxe
Copy link
Member

@MikeHillberg @BenJKuhn @Scottj1s is a Single File App (PublishSingleFile = true) a problem for WinAppSDK or a N/A and this is a WinUI issue?

If the latter please transfer it to the WinUI repo (oddly enough I can't).

If the former who's on point?

@ghost1372
Copy link
Contributor Author

Hi @riverar
Can you confirm this issue?

@riverar
Copy link
Contributor

riverar commented May 24, 2022

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: #6400, #7063, #6757, etc.

Best guidance for you right now is to completely avoid using Single File publishing for all WinUI/WinAppSDK work.

@marb2000
Copy link
Contributor

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.

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label May 25, 2022
@marb2000 marb2000 transferred this issue from microsoft/WindowsAppSDK May 25, 2022
@marb2000 marb2000 added bug Something isn't working area-InfoBar and removed area-Windowing labels May 25, 2022
@ojhad ojhad added product-winui3 WinUI 3 issues and removed needs-triage Issue needs to be triaged by the area owners labels May 25, 2022
@MikeHillberg
Copy link
Contributor

This crashes for you just running from VS (Control+F5)? I put your markup in a new app, set <PublishSingleFile>true</PublishSingleFile> in the project file, and can't repro the crash.

@ghost1372
Copy link
Contributor Author

ghost1372 commented Jun 15, 2022

Hi @MikeHillberg , When running through VS I have no problem and Everything works well.
I attached a sample, Please publish the project with the following settings

<Project>
  <PropertyGroup>
    <PublishProtocol>FileSystem</PublishProtocol>
    <Platform>x86</Platform>
    <RuntimeIdentifier>win10-x86</RuntimeIdentifier>
    <PublishDir>bin\\\win10-x86\publish\</PublishDir>
    <SelfContained>true</SelfContained>
    <PublishSingleFile>true</PublishSingleFile>
    <PublishReadyToRun>true</PublishReadyToRun>
    <Configuration>Release</Configuration>
    <TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
    <PublishTrimmed>false</PublishTrimmed>
  </PropertyGroup>
</Project>

Please note that there is an InfoBar in MainWindow

App9.zip

1

Animation

If we execute the published file through Visual Studio (Debug mode), we will get error
Animation2

@ghost1372
Copy link
Contributor Author

@MikeHillberg
Copy link
Contributor

Thank you @ghost1372!

@DrusTheAxe?

00 Microsoft_WindowsAppRuntime_Bootstrap!MddBootstrap_StopActivity
01 Microsoft_WindowsAppRuntime_Bootstrap!wilResultLoggingThreadCallback
02 Microsoft_WindowsAppRuntime_Bootstrap!wil::details::ThreadFailureCallbackFn<bool (__stdcall&)(wil::FailureInfo const &) noexcept>::NotifyFailure
03 Microsoft_WindowsAppRuntime_Bootstrap!wil::details::ThreadFailureCallbackHolder::GetContextAndNotifyFailure
04 Microsoft_WindowsAppRuntime_Bootstrap!wil::details::GetContextAndNotifyFailure
05 Microsoft_WindowsAppRuntime_Bootstrap!wil::details::LogFailure
06 Microsoft_WindowsAppRuntime_Bootstrap!wil::details::ReportFailure_NoReturn<0>
07 Microsoft_WindowsAppRuntime_Bootstrap!wil::details::ReportFailure_Base<0,0>
08 Microsoft_WindowsAppRuntime_Bootstrap!wil::details::ReportFailure_Msg<0>
09 Microsoft_WindowsAppRuntime_Bootstrap!wil::details::ReportFailure_HrMsg<0>
0a Microsoft_WindowsAppRuntime_Bootstrap!wil::details::in1diag3::_Throw_HrMsg
0b Microsoft_WindowsAppRuntime_Bootstrap!wil::details::in1diag3::Throw_HrIfMsg
0c Microsoft_WindowsAppRuntime_Bootstrap!FindDDLMViaEnumeration
0d Microsoft_WindowsAppRuntime_Bootstrap!CreateLifetimeManagerViaEnumeration
0e Microsoft_WindowsAppRuntime_Bootstrap!CreateLifetimeManager
0f Microsoft_WindowsAppRuntime_Bootstrap!FirstTimeInitialization
10 Microsoft_WindowsAppRuntime_Bootstrap!_MddBootstrapInitialize
11 Microsoft_WindowsAppRuntime_Bootstrap!MddBootstrapInitialize2

@DrusTheAxe
Copy link
Member

DrusTheAxe commented Jun 17, 2022

Please run the following command and share the results:

powershell -c "$(get-appxpackage *micro*win*apprun*).packagefullname"

The description and callstack sounds like WindowsAppSDK issue #2592 -- if the Bootstrap API doesn't find a qualifying package it reports the issue before returning but that has a bug which causes a crash. This is fixed in main for vNext and queued up for servicing review for our next update (1.1.2).

That Powershell command will list what WinAppSDK MSIX packages are registered for the user. If the runtime isn't installed1 it will cause this crash in the Bootstrap API. If that's your issue as a workaround you can run the WinAppSDK installer and see if the problem repros.

1 Or is incompletely installed e.g. if Microsoft.WindowsAppRuntime.1.1 is registered for the user but MicrosoftCorporationII.WinAppRuntime.Main.1.1 is not.

@ghost1372
Copy link
Contributor Author

Thank you @DrusTheAxe
this is my runtimes
image

@ghost1372
Copy link
Contributor Author

Hi,
@DrusTheAxe
@MikeHillberg

I tested with version 1.1.2, It seems that the Bootstrapp issue has been fixed but now i get another exception

Exception thrown at 0x00007FFC5FCBFA7C (KernelBase.dll) in App24.exe: 0xE0434352 (parameters: 0xFFFFFFFF80004003, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x00007FF7EA720000).
Exception thrown at 0x00007FFC5FCBFA7C (KernelBase.dll) in App24.exe: 0xE0434352 (parameters: 0xFFFFFFFF80131534, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x00007FF7EA720000).
Exception thrown at 0x00007FFC5FCBFA7C (KernelBase.dll) in App24.exe: 0xE0434352 (parameters: 0xFFFFFFFF80131534, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x00007FF7EA720000).
Exception thrown at 0x00007FFC5FCBFA7C (KernelBase.dll) in App24.exe: WinRT originate error - 0x80131534 : 'The type initializer for '_IInfoBarFactory' threw an exception.'.
onecore\com\combase\winrt\error\restrictederror.cpp(1017)\combase.dll!00007FFC61E4C2CA: (caller: 00007FFC61E5183F) ReturnHr(1) tid(cd4) 8007007E The specified module could not be found.
Exception thrown at 0x00007FFC5FCBFA7C (KernelBase.dll) in App24.exe: WinRT originate error - 0x802B000A : 'Cannot create instance of type 'Microsoft.UI.Xaml.Controls.InfoBar' [Line: 0 Position: 0]'.
onecore\com\combase\winrt\error\restrictederror.cpp(1017)\combase.dll!00007FFC61E4C2CA: (caller: 00007FFC61E5183F) ReturnHr(2) tid(cd4) 8007007E The specified module could not be found.
Exception thrown at 0x00007FFC5FCBFA7C (KernelBase.dll) in App24.exe: 0xE0434352 (parameters: 0xFFFFFFFF802B000A, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x00007FF7EA720000).
Exception thrown at 0x00007FFC5FCBFA7C (KernelBase.dll) in App24.exe: WinRT originate error - 0x802B000A : 'XAML parsing failed.'.
onecore\com\combase\winrt\error\restrictederror.cpp(1017)\combase.dll!00007FFC61E4C2CA: (caller: 00007FFC61E5183F) ReturnHr(3) tid(cd4) 8007007E The specified module could not be found.
Exception thrown at 0x00007FFC5FCBFA7C (KernelBase.dll) in App24.exe: WinRT originate error - 0x802B000A : 'A failure occurred in Application::OnLaunched, the application is unable to start.'.
onecore\com\combase\winrt\error\restrictederror.cpp(1017)\combase.dll!00007FFC61E4C2CA: (caller: 00007FFC61E5183F) ReturnHr(4) tid(cd4) 8007007E The specified module could not be found.
onecore\com\combase\winrt\error\restrictederror.cpp(1017)\combase.dll!00007FFC61E4C2CA: (caller: 00007FFC61FACC92) ReturnHr(5) tid(cd4) 8007007E The specified module could not be found.
onecore\com\combase\winrt\error\restrictederror.cpp(1017)\combase.dll!00007FFC61E4C2CA: (caller: 00007FFC61FAC66E) ReturnHr(6) tid(cd4) 8007007E The specified module could not be found.
Unhandled exception at 0x00007FFBCEC5F33C (Microsoft.ui.xaml.dll) in App24.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x000000002EB0CC90, 0x0000000000000003).

and this is dump from visual studio

https://drive.google.com/file/d/12bejvbCSjrjdJewbc-lAfDh9CMAL5Nrn/view?usp=sharing

image

@ghost1372
Copy link
Contributor Author

Hi @MikeHillberg @DrusTheAxe
I tested with v1.1.4 and v1.2-experimental1
None of them work and the app keeps crashing, Please check and fix this problem.

@mvsilfho
Copy link

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).

@bpulliam bpulliam added the Crash whenever user reports a crash or app freeze label Oct 13, 2022
@bpulliam bpulliam added the team-Markup Issue for the Markup team label Oct 30, 2022
@nor0x
Copy link

nor0x commented Jan 6, 2023

any updates on this?

a standard
dotnet publish -f net7.0-windows10.0.19041.0 -c Release -p:Platform=x64
with the flag
<PublishSingleFile>true</PublishSingleFile>
produces a crashing exe even in a blank project.

Logs from Event Viewer

Faulting application name: WinTest.exe, version: 1.0.0.0, time stamp: 0x6377b117
Faulting module name: Microsoft.ui.xaml.dll, version: 3.0.0.2212, time stamp: 0x7dc2efab
Exception code: 0xc000027b
Fault offset: 0x00000000002a2177

nor0x added a commit to nor0x/Dots that referenced this issue Jan 6, 2023
PublishSingleFile is not working - documentation in MAUI and WASDK is a nightmare 🤮

adding these issues as a reference to check in the future
https://github.com/microsoft/WindowsAppSDK/issues/3042
microsoft/microsoft-ui-xaml#7143
dotnet/maui#4329
@Scottj1s Scottj1s self-assigned this Apr 17, 2023
@ghost1372
Copy link
Contributor Author

Hi @Scottj1s
any news about this issue?

@Scottj1s
Copy link
Member

@ghost1372 No updates - hopefully soon. Thanks for your patience.

@HEIC-to-JPEG-Dev
Copy link

SDK 1.4 - My apps crash with InfoBar, even when not using the "Single File Option"

@ghost1372
Copy link
Contributor Author

Today I tested again with the latest version 1.4.2 and got interesting results:

  1. A Blank WinUI 3 app with an InfoBar can be run without any issues! i used this configs:
PublishSingleFile = True
WindowsAppSDKSelfContained = True
PublishReadyToRun = True
SelfContained = True
  1. A Blank WinUI 3 app with an InfoBar can not run and crash app. i used this configs:
IncludeNativeLibrariesForSelfExtract = True
PublishSingleFile = True
WindowsAppSDKSelfContained = True
PublishReadyToRun = True
SelfContained = True

It seems that this bug has been solved partially and the app can be run, but adding IncludeNativeLibrariesForSelfExtract property still causes it to crash.
It should also be noted that I have not yet tested it in real and large applications And I just tried on a new and blank project.

@Scottj1s
Copy link
Member

Windows App SDK 1.5 now supports PublishSingleFile:
https://www.nuget.org/packages/Microsoft.WindowsAppSDK/1.5.240227000

@tpoint75
Copy link

tpoint75 commented Oct 2, 2024

Whats about winrt/c++ ?

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-InfoBar bug Something isn't working Crash whenever user reports a crash or app freeze needs-triage Issue needs to be triaged by the area owners product-winui3 WinUI 3 issues team-Markup Issue for the Markup team
Projects
None yet
Development

No branches or pull requests