microsoft / appcenter-sdk-dotnet

Development repository for the App Center SDK for .NET platforms, including Xamarin
Other
311 stars 141 forks source link

System.InvalidOperationException in UWP application. #1726

Closed LuckyBeetle closed 1 year ago

LuckyBeetle commented 1 year ago

Description

In my Windows UWP app I receive regular crash report that I can not really figure out how to fix. Based on the call stack trace it feels it could be related to the SDK.

Repro Steps

I can not figure out how to reproduce it.

Details

Here is a crash:

ComCallHelpers.Call (_ComObject, RuntimeTypeHandle, Int32)
System.InvalidOperationException: A method was called at an unexpected time. LocalizeView failed with 0x8000000e.

CallStack available:

System.Runtime.InteropServices McgMarshal.ThrowOnExternalCallFailed (Int32, RuntimeTypeHandle)
__Interop ComCallHelpers.Call (__ComObject, RuntimeTypeHandle, Int32)
__Interop ForwardComStubs.Stub_11[TThis] (__ComObject, Int32)
Microsoft.AppCenter.Utils ApplicationLifecycleHelper.<ctor>b__17_1 (Object, UnhandledErrorDetectedEventArgs)

It happens the most on windows versions 10.0.2200, 10.0.19045, 10.0.19044 I have latest SDK installed and targeting Windows platform 2004

DmitriyKirakosyan commented 1 year ago

Hi @LuckyBeetle , you can see Microsoft.AppCenter.Utils ApplicationLifecycleHelper in your logs because it has an error catching logic. It isn't related to the crash itself.

I would suggest to add analytics to your app to help identifying the place of the issue. In your case the error message A method was called at an unexpected time could be related to using async operations. Also worth checking the class LocalizeView, as it is mentioned in the error message.

I'm closing it as not an SDK issue, but feel free to ask any additional questions.

LuckyBeetle commented 1 year ago

Hi @LuckyBeetle , you can see Microsoft.AppCenter.Utils ApplicationLifecycleHelper in your logs because it has an error catching logic. It isn't related to the crash itself.

I would suggest to add analytics to your app to help identifying the place of the issue. In your case the error message A method was called at an unexpected time could be related to using async operations. Also worth checking the class LocalizeView, as it is mentioned in the error message.

I'm closing it as not an SDK issue, but feel free to ask any additional questions.

Thank you for the feedback! I will try to add analytics to get more information. By the way 'LocalizeView' is not a part of my code and I can not locate its origin.