UWP:'CurrentApp' 认证崩溃

UWP: 'CurrentApp' crashes in certification

我有一个问题,在将 UWP 应用程序提交到应用商店时,我不知道是使用 CurrentApp 还是 CurrentAppSimulator

当我将代码从 CurrentAppSimulator 更改为 CurrentApp 时,它不仅在我的个人计算机 运行 测试中崩溃,而且在认证过程中也崩溃。我该如何解决?显然应用程序还没有发布,但我也不能使用 CurrentAppSimulator,因为获得认证的包最终也会在商店中...

我应该怎么做才能解决这个问题?

提交到商店的应用程序必须使用 CurrentApp class。

查看可用信息here,可以阅读以下内容:

This object obtains its data from the Windows Store, so you must have a developer account and the app must be published in the Windows Store. Before submitting to the Windows Store, you can test your code with a simulated version of this class (whose state is initialized from an XML file). See CurrentAppSimulator.

问题可能是缺少网络访问(CurrentApp 所依赖的)而不是 CurrentApp 本身的问题。

处理 CurrentApp 调用的异常,这样失败就不会导致应用程序崩溃。如果无法到达商店服务器,CurrentApp 可能会失败。如果应用程序未发布(可能在您的本地测试中)或网络不可用(可能在证书测试中并且可能在真实世界的客户使用中),则可能会出现这种情况

Avoid Common Certification Failures