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

WPF Desktop bridge app does not report crashes to the AppCenter #1742

Closed
marekdovjak opened this issue May 24, 2023 · 21 comments
Closed

WPF Desktop bridge app does not report crashes to the AppCenter #1742

marekdovjak opened this issue May 24, 2023 · 21 comments
Labels

Comments

@marekdovjak
Copy link

marekdovjak commented May 24, 2023

Description

We have a WPF application, which is distributed in the MSStore using the Windows Desktop bridge. While the application is tested as pure WPF app, it's properly reporting crashes to the AppCenter. But after packaging the exact same app using the Desktop bridge, crashes are no logner reported.

After enabling the Verbose log level and generating test crash, I can see there are 0 crash reports detected. I also checked the Logs.db file in user's AppData folder, table LogEntry doesn't contain any crash reports. It contains few core/analytics records, which are correctly sent to the AppCenter after running the app.

Repro Steps

  1. Create simple wpf app project with the appcenter sdk
  2. Generate test crash
  3. Verify the crash is reported to the AppCenter
  4. Add Windows Application Packaging project for the wpf app to the solution
  5. Run the Packaging project
  6. Generate test crash
  7. Crash is not reported to the AppCenter

Details

Platform: Win10, WPF, NET 7.0, Desktop Bridge
SDK version 5.0.2
OS: Windows 10/11
Visual Studio Version 17.6.0

Workaround

I used the DispatcherUnhandledException += App_DispatcherUnhandledException; and

void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
    Crashes.TrackError(e.Exception);
}

as recommended in this issue #1727, so crashes are reported as errors now.

@DmitriyKirakosyan
Copy link
Contributor

Hi @marekdovjak , thank you for this report. I believe it is a duplicate of #1727.

We already merged the fix and currently preparing the release. It should be available today or tomorrow.
I'm closing it as a duplicate.

@marekdovjak
Copy link
Author

@DmitriyKirakosyan I don't think it's duplicate. For wpf app, everything is working well. We have problems when packaging the wpf app with Windows Desktop Bridge.

After upgrading the AppCenter SDK to 5.0.2, problem still persits

@DmitriyKirakosyan
Copy link
Contributor

Thank you for testing on new version and confirming the issue persists. We will investigate it.

You mentioned that using DispatcherUnhandledException works well for you as a workaround. In the latest version we added DispatcherUnhandledException event listener for catching exceptions, so I would expect it should resolve your issue...

@MikhailSuendukov
Copy link
Contributor

Hello, I tried to reproduce your error, but when running a WPF application using Windows Application Packaging, crashes are successfully sent to the AppCenter portal. For further investigation, a small demo application that reproduces your error would be very useful to us.

@marekdovjak
Copy link
Author

@MikhailSuendukov I realized that the steps I wrote to reproduce the problem were not complete. You have to use the Target Framework Moniker option. So instead of <TargetFramework>net7.0-windows</TargetFramework> use <TargetFramework>net7.0-windows10.0.17763.0</TargetFramework> or similar.

There's simple demo app in the attachment. With the moniker option, crashes are not reported.

WpfApp1.zip

@MikhailSuendukov
Copy link
Contributor

Thank you very much for your demo app, indeed your bug is reproducible on this app. In that case, I will create a work item on our board and keep you updated on progress.

@DmitriyKirakosyan
Copy link
Contributor

The fix was released, so I'm closing it.

@marekdovjak
Copy link
Author

@DmitriyKirakosyan I did a quick test with the sample app I provided earlier and appcenter 5.0.3 - it still doesn't work with the target WapProjTemplate1 (desktop bridge).

@MikhailSuendukov
Copy link
Contributor

Hi, I was able to reproduce the error, apparently the SDK incorrectly determines the type of the wrapped application, so I created a draft pull request to fix the bug.

@sebaJoSt
Copy link

when is the next release with this bug fix planned?

1 similar comment
@30797593
Copy link

30797593 commented Mar 5, 2024

when is the next release with this bug fix planned?

@30797593
Copy link

30797593 commented Mar 5, 2024

I am encountering the same issue. The project, packaged as a WPF and uploaded to the Microsoft Store, can collect reports in its pure WPF form, but once packaged with the Desktop Bridge, it no longer can.

@MikhailSuendukov
Copy link
Contributor

Hello, the AppCenter .NET SDK v5.0.4 has been released, including a fix for this issue. Therefore, I am closing this issue.

@sebaJoSt
Copy link

@MikhailSuendukov
My bridged app with the newest version of v5.0.4 does not show up in appcenter at all, neither analytic events nor crashes. With 5.0.3 at least events worked

<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<UseWPF>true</UseWPF>

@MikhailSuendukov
Copy link
Contributor

MikhailSuendukov commented Jun 13, 2024

@sebaJoSt
Thank you for reaching out to us. Yesterday, we experienced issues with the Analytics service. Could you please try testing your application again using AppCenter .NET SDK version 5.0.4?

@sebaJoSt
Copy link

I already tried again. My app update with 5.0.4 was released on June 4th and it still not appeared in AppCenter.

@MikhailSuendukov
Copy link
Contributor

@sebaJoSt
I tried to reproduce this issue on 5.0.4 version, but everything works as expected for me, it would be useful if you could provide a simple demo application that reproduces this error and repro steps for it.

@sebaJoSt
Copy link

@MikhailSuendukov
Thanks for your help. I just downgraded to 5.0.3 and published the app update in Microsoft Store and analytics are back! Unfortunately I'm busy with other topics and can't give support to reproduce this.

@MikhailSuendukov
Copy link
Contributor

@sebaJoSt
Verbose logs from your application can greatly assist us too. When you have a moment, could you please provide these logs? To enable verbose logging, set the log level as shown below before invoking the AppCenter.Start function:
AppCenter.LogLevel = LogLevel.Verbose;

@sebaJoSt
Copy link

@MikhailSuendukov
Here's verbose output of 5.0.5.
Nothing is appearing in Log FLow with this version. Going back to 5.0.3 and the events appear.
Debug_5_0_5.txt

@MikhailSuendukov
Copy link
Contributor

@sebaJoSt
Judging by your logs, events are successfully sent to the service. To further investigation, we will need a simple demo application that reproduces this error and repro steps for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants