Forum Xamarin.Forms

UWP / Xamarin crash in submission tests when I try to upload a microsoft store

IVANLABRADORIVANLABRADOR USMember ✭✭

I am working with Xamarin Forms on a message sending application with SignalR, which I have tested countless times locally and on Android and it works fine without crashes, but when they do the tests to upload it to the microsoft store they report that my application crashes .

According to the App center, the application crashes when they trying to send a message through SignalR, this is the error:

< SendPrivateMessageAsync> d__46.MoveNext () + 0x14b System.Reflection.MissingMetadataException: This operation cannot be carried out because metadata for the following object was removed for performance reasons:\n\n EETypeRva:0x0035FCD8\n\nNo further information is available. Rebuild in debug mode for better information.\n\n

System.Reflection.Runtime.TypeInfos
RuntimeNoMetadataNamedTypeInfo.get_InternalFullNameOfAssembly () f:\dd\ndp\fxcore\CoreRT\src\System.Private.Reflection.Core\src\System\Reflection\Runtime\TypeInfos\RuntimeBlockedTypeInfo.cs at 240:17
System.Text.Json
JsonPropertyInfo.Initialize (Type, Type, Type, Type, PropertyInfo, Type, JsonConverter, JsonSerializerOptions) + 0x11f
System.Text.Json
JsonPropertyInfoCommon`4.Initialize (Type, Type, Type, Type, PropertyInfo, Type, JsonConverter, JsonSerializerOptions) + 0x:59
System.Text.Json
JsonClassInfo.CreateProperty (Type, Type, Type, PropertyInfo, Type, JsonConverter, JsonSerializerOptions) + 0x2f:2
System.Text.Json
JsonClassInfo.AddProperty (Type, PropertyInfo, Type, JsonSerializerOptions) + 0x9e
System.Text.Json
JsonClassInfo.AddPolicyProperty (Type, JsonSerializerOptions) + 0x2f
System.Text.Json.JsonClassInfo
+ 0xdd:1
System.Text.Json
JsonSerializerOptions.GetOrAddClass (Type) + 0x:71
System.Text.Json
WriteStackFrame.Initialize (Type, JsonSerializerOptions) + 0x:13
System.Text.Json
JsonSerializer.WriteCore (Utf8JsonWriter, Object, Type, JsonSerializerOptions) + 0x8d
System.Text.Json
JsonSerializer.WriteValueCore (Utf8JsonWriter, Object, Type, JsonSerializerOptions) + 0x3e
Microsoft.AspNetCore.SignalR.Protocol
JsonHubProtocol.WriteArguments (Object[], Utf8JsonWriter) + 0x1ef
Microsoft.AspNetCore.SignalR.Protocol
JsonHubProtocol.WriteStreamInvocationMessage (StreamInvocationMessage, Utf8JsonWriter) + 0x:65
Microsoft.AspNetCore.SignalR.Protocol
JsonHubProtocol.WriteMessageCore (HubMessage, IBufferWriter`1) + 0x55d
Microsoft.AspNetCore.SignalR.Protocol
JsonHubProtocol.WriteMessage (HubMessage, IBufferWriter`1) + 0xc
Microsoft.AspNetCore.SignalR.Client.HubConnection
<SendHubMessage>d__72.MoveNext () + 0x7f
System.Runtime.ExceptionServices
ExceptionDispatchInfo.Throw () + 0x:21
System.Runtime.CompilerServices
TaskAwaiter.ThrowForNonSuccess (Task) + 0x:70
System.Runtime.CompilerServices
TaskAwaiter.HandleNonSuccessAndDebuggerNotification (Task) + 0x:38
System.Runtime.CompilerServices
TaskAwaiter.ValidateEnd (Task) + 0x:17
System.Runtime.CompilerServices
TaskAwaiter.GetResult () + 0xb
Microsoft.AspNetCore.SignalR.Client.HubConnection
<InvokeCore>d__70.MoveNext () + 0x:194
System.Runtime.ExceptionServices
ExceptionDispatchInfo.Throw () + 0x:21
System.Runtime.CompilerServices
TaskAwaiter.ThrowForNonSuccess (Task) + 0x:70
System.Runtime.CompilerServices
TaskAwaiter.HandleNonSuccessAndDebuggerNotification (Task) + 0x:38
System.Runtime.CompilerServices
TaskAwaiter.ValidateEnd (Task) + 0x:17
Microsoft.AspNetCore.SignalR.Client.HubConnection
<InvokeCoreAsyncCore>d__69.MoveNext () + 0x:335
System.Runtime.ExceptionServices
ExceptionDispatchInfo.Throw () + 0x:21
System.Runtime.CompilerServices
TaskAwaiter.ThrowForNonSuccess (Task) + 0x:70
System.Runtime.CompilerServices
TaskAwaiter.HandleNonSuccessAndDebuggerNotification (Task) + 0x:38
System.Runtime.CompilerServices
TaskAwaiter.ValidateEnd (Task) + 0x:17
System.Threading.Tasks
ForceAsyncAwaiter`1.GetResult () + 0x:18
Microsoft.AspNetCore.SignalR.Client.HubConnection
<InvokeCoreAsync>d__56.MoveNext () + 0x:105
System.Runtime.ExceptionServices
ExceptionDispatchInfo.Throw () + 0x:21
System.Runtime.CompilerServices
TaskAwaiter.ThrowForNonSuccess (Task) + 0x:70
System.Runtime.CompilerServices
TaskAwaiter.HandleNonSuccessAndDebuggerNotification (Task) + 0x:38
System.Runtime.CompilerServices
TaskAwaiter.ValidateEnd (Task) + 0x:17
System.Runtime.CompilerServices
TaskAwaiter.GetResult () + 0xb
Chat.Shared.Core.ChatService
<SendPrivateMessageAsync>d__46.MoveNext () + 0x14b
System.Runtime.ExceptionServices
ExceptionDispatchInfo.Throw () + 0x:21
System.Runtime.CompilerServices
TaskAwaiter.ThrowForNonSuccess (Task) + 0x:70
System.Runtime.CompilerServices
TaskAwaiter.HandleNonSuccessAndDebuggerNotification (Task) + 0x:38
System.Runtime.CompilerServices
TaskAwaiter.ValidateEnd (Task) + 0x:17
System.Runtime.CompilerServices
TaskAwaiter.GetResult () + 0xb
MyClinicalApp.ViewModels.ChatViewModel.<>c__DisplayClass39_1
<<SendMessage>b__1>d.MoveNext () + 0x:137
System.Runtime.ExceptionServices
ExceptionDispatchInfo.Throw () + 0x:21
System.Runtime.CompilerServices.AsyncMethodBuilderCore
<>c.<ThrowAsync>b__7_0 (Object) + 0x1e
System
Action`1.Invoke (T) + 0x:28
System.Threading.WinRTSynchronizationContext
Invoker.InvokeCore () + 0x:33
System.Runtime.InteropServices
McgMarshal.ThrowOnExternalCallFailed (Int32, RuntimeTypeHandle) + 0x:21
__Interop
ComCallHelpers.Call (__ComObject, RuntimeTypeHandle, Int32) + 0xb:8
__Interop
ForwardComStubs.Stub_15[TThis] (__ComObject, Int32) + 0x:24
Microsoft.AppCenter.Utils
ApplicationLifecycleHelper.<ctor>b__17_1 (Object, UnhandledErrorDetectedEventArgs) + 0x3d

If someone can give me any tips or advice on how to determine the error. thank you.

P.S. I have also tried Upload debug symbols but I think there is an error in the app center page or I'm probably doing something wrong, the problem is that after about 20min trying to upload the page is cleaned and nothing was ever uploaded, this process will I have tried 7 times and I never manage to upload the .appxsym

Best Answer

Answers

  • JarvanJarvan Member, Xamarin Team Xamurai
    edited January 9

    Because .NET Native does not presently have a just-in-time compiler to compile the pieces that are missing, everything that can be accessed at runtime needs to be known at the time of compilation. Your app will encounter a MissingMetadataException or MissingRuntimeArtifactException if it attempts to use something that was removed.

    Here is a troubleshooter about MissingMetadataException, hope it'll help you.

  • IVANLABRADORIVANLABRADOR USMember ✭✭

    @Jarvan said:
    Because .NET Native does not presently have a just-in-time compiler to compile the pieces that are missing, everything that can be accessed at runtime needs to be known at the time of compilation. Your app will encounter a MissingMetadataException or MissingRuntimeArtifactException if it attempts to use something that was removed.

    Here is a troubleshooter about MissingMetadataException, hope it'll help you.

    Hi Thank you for responding, I have already tried many options to modify the rd.xml but none seems to prevent the error from happening, will you have any suggestions on how I can edit it or rather what should I add to avoid this error? Thank you.

  • JarvanJarvan Member, Xamarin Team Xamurai
    edited January 10 Accepted Answer

    The .NET Native runtime tells you that some types/properties etc have been incorrectly optimized away. To avoid this, add the Type info into the Properties\Default.rd.xml file. Something like:

    <Type Name="Some.Type.We.Want.To.Save" Dynamic="Required All />
    

    Refer to: https://github.com/dotnet/runtime/issues/978#issuecomment-567299066

Sign In or Register to comment.