c# - Windows 应用商店 CurrentApp.LoadListingInformationAsync() - 错误 0x801900cc

标签 c# windows visual-studio windows-store-apps windows-store

我在商店中有一个 Windows 8.1 应用程序,但是当我尝试使用下一段代码来实现我想添加到我的应用程序中的新功能时

var listingInfo = await CurrentApp.LoadListingInformationAsync();

我收到一条错误消息,但我并不完全了解它的含义。不过,我确实发现了错误,并将其显示在 MessageDialog 上,然后打印了一个屏幕。这是错误:

We could not receive your donation due to an unexpected error:
System.Exception: Exception from HRESULT: 0x801900CC
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)
    at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
    at ArchMedia_Player.Services.Donations.<ListingInformationAsync> d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)
    at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
    at ArchMedia_Player.Services.Donations.<Donate>d__a.MoveNext()

有谁知道那是什么意思,我该如何解决? 我还提到这完全可以:(使用 CurrentApp Simulator)

var listingInfo = await CurrentAppSimulator.LoadListingInformationAsync();

最佳答案

System.Exception: Exception from HRESULT: 0x801900CC

这是您开发应用程序时的预期异常。错误码为BG_E_HTTP_ERROR_204,0xCC编码HTTP响应错误码。 0xCC == 204,HTTP 错误 204 表示“无内容”。或者换句话说,商店服务器不知道您的应用有任何应用内购买。

这是一个先有鸡还是先有蛋的问题,在您提交应用并获得批准之前,服务器不知道您的应用内购买。您必须使用 CurrentAppSimuator 测试您的应用程序以调试和测试您的应用程序内购买。基本操作指南 is here .您一定不要忘记的一个重要步骤是在提交您的应用程序进行验证之前用 CurrentApp 替换 CurrentAppSimulator。

当您将应用内购买添加到新版本时,您的应用已经在应用商店中不会被考虑在内。关键的必需步骤是让商店服务器知道您的购买选项。如链接的 MSDN 文章所述,您在提交应用程序时执行此操作。在您的提交获得批准之前,它们不会生效。

所以,不要 panic ,您可以使用模拟器测试您的代码。当您确认可以正常工作时,只要您按照 MSDN 文章中的步骤操作,就没有理由担心在提交应用程序后会出现问题。

关于c# - Windows 应用商店 CurrentApp.LoadListingInformationAsync() - 错误 0x801900cc,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24963888/

相关文章:

c++ - 如何使用C++在Windows中获取系统信息

windows - Windows 中的 F1 : Should it open the program's help screen OR show help text?

c++ - 将运行时库用作 dll 时无法进入 CRT 代码

visual-studio - 在 Visual Studio 中为 Azure Nuget 源添加凭据

c# - 执行 ChartImg.axd 的子请求时出错。这不是重复的

c# - 在 C# 中停用和激活 Azure WebJobs

c# - LINQ to SQL - 从 X WHERE X = "1"选择 Y

c# - 获取 ListView 的选定项目(MVVM、Caliburn.Micro)

c# - 如何正确进行异步/并行数据库调用

c# - 如何将 native C++ 内存转换为 C# 结构?