[UWP / Xamarin在我尝试上载Microsoft商店时在提交测试中崩溃

问题描述 投票:0回答:1

我正在与Xamarin Forms一起使用SignalR在消息发送应用程序上工作,该应用程序已经在本地和Android上进行了无数次测试,并且工作正常而没有崩溃,但是当他们进行测试以将其上传到Microsoft商店时,他们报告说我应用程序崩溃。

根据应用程序中心,当应用程序尝试通过SignalR发送消息时崩溃,这是错误:

d__46.MoveNext()+ 0x14bSystem.Reflection.MissingMetadataException:无法执行此操作,因为出于性能原因删除了以下对象的元数据:\ n \ n EETypeRva:0x0035FCD8 \ n \ n没有更多可用信息。以调试模式重建以获得更多信息。\ 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

[如果有人可以给我有关如何确定错误的任何提示或建议。谢谢。

P.S。我也尝试了上载调试符号,但我认为应用程序中心页面中有错误,或者我可能做错了问题,问题在于尝试上载页面约20分钟后,此内容已清除,并且从未上载任何内容,我会尝试7次,但从未尝试上传.appxsym

xamarin xamarin.forms uwp signalr visual-studio-app-center
1个回答
0
投票

您看到的问题是由.NET Native工具链剥离代码以使程序集更小,更快所引起的。不幸的是,.NET Native不够聪明,无法理解何时需要反映一种类型,有时可能会删除您实际上需要的元数据。

调试此过程有点复杂,因为您需要尝试确切地确定哪种类型的元数据是必需的并且丢失,并在Default.rd.xml文件中将该类型标记为必需,您可以在Properties文件中找到该类型UWP项目。有一个非常有用的在线.NET Native MissingMetadataException troubleshooter。旨在为您自动生成正确的rd.xml语法。您只需要做的就是填写类型/名称空间名称,并指定如何反映类型。

要找到问题的确切根源,请在Visual Studio中将构建配置切换到Release,然后运行该应用程序,并观察它在哪一点崩溃。有时还有助于注释和取消注释代码,以找出发生错误的确切位置。在您的情况下,我怀疑这是由于JSON序列化和反序列化(通常会发生这种情况),因为类型仅用于此唯一目的,并且属性“出现”,好像没有在任何地方引用。

© www.soinside.com 2019 - 2024. All rights reserved.