首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >当我尝试上传microsoft商店时,UWP / Xamarin在提交测试中崩溃

当我尝试上传microsoft商店时,UWP / Xamarin在提交测试中崩溃
EN

Stack Overflow用户
提问于 2020-01-09 00:49:45
回答 2查看 265关注 0票数 0

我正在使用Xamarin Forms开发一个带有SignalR的消息发送应用程序,我已经在本地和Android上测试了无数次,它工作得很好,没有崩溃,但当他们测试上传到微软商店时,他们报告说我的应用程序崩溃了。

根据应用程序中心的说法,当他们试图通过SignalR发送消息时,应用程序崩溃,这是错误:

< SendPrivateMessageAsync> d__46.MoveNext () + 0x14b System.Reflection.MissingMetadataException:无法执行此操作,因为由于性能原因,已删除以下对象的元数据:\n\n EETypeRva:0x0035FCD8\n\n没有详细信息。在调试模式下重新生成以获取更好的信息。\n\n

代码语言:javascript
运行
复制
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

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

另外,我也尝试过上传调试符号,但我认为在应用程序中心页面有一个错误,或者我可能做错了什么,问题是在尝试上传页面大约20分钟后,没有任何东西被上传,这个过程我已经尝试了7次,但我从未设法上传过.appxsym

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-01-10 22:08:57

感谢Martin Zikmund帮助我理解了这个问题。

为了发现错误的根源,有必要在启用.NET本机的调试配置中进行编译(项目Properties> Build>启用".NET本机工具链“复选框)。通过这种方式,我能够确定是哪个MissingMetadataException,从而能够正确地形成rd.xml文件。

在我的例子中,它是这样更正的:

代码语言:javascript
运行
复制
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
  <Application>
    <!--
      An Assembly element with Name="*Application*" applies to all assemblies in
      the application package. The asterisks are not wildcards.
    -->
    <Assembly Name="*Application*" Dynamic="Required All" />

    <Type Name="System.Text.Json.Serialization.Converters.JsonConverterString" Dynamic="Required All" />
    <Type Name="System.Text.Json.Serialization.Converters.JsonConverterBoolean" Dynamic="Required All" />
    <Type Name="System.Text.Json.Serialization.Converters.JsonConverterObject" Dynamic="Required All" />
    <Type Name="System.Text.Json.Serialization.Converters.JsonConverterByteArray" Dynamic="Required All" />
    <Type Name="System.Text.Json.Serialization.Converters.JsonConverterDateTime" Dynamic="Required All" />

  </Application>
</Directives>

也感谢Jarvan y Matthew Whilden花时间帮助我解决这个问题。

票数 1
EN

Stack Overflow用户

发布于 2020-01-09 05:46:22

您看到的问题是由.NET本机工具链剥离代码以使程序集更小、更快引起的。不幸的是,.NET Native不够聪明,不能理解什么时候需要反射类型,有时可能会删除您实际上需要的元数据。

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

要找到问题的确切根源,请在Visual Studio中将构建配置切换为Release,然后运行应用程序并观察它在哪一点崩溃。它有时还有助于注释和取消注释代码,以找出它发生时的确切位置。在您的例子中,我怀疑这是由于JSON序列化和反序列化,这可能经常发生,因为类型仅用于此唯一目的,而属性“看起来”就像没有在任何地方引用一样。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59650405

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档