Windows Store CurrentApp.LoadListingInformationAsy

2019-08-11 22:32发布

I have a Windows 8.1 app on the Store, but when I try to use the next piece of code for a new feature I want to add to my app

var listingInfo = await CurrentApp.LoadListingInformationAsync();

I receive an error which I don't exactly know what it means. I did catch the error though and I displayed it on a MessageDialog and then I took a print screen. This is the error:

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()

Does anybody know what that means and how can I solve it ? I also mention that this works perfectly ok: (using the CurrentApp Simulator)

var listingInfo = await CurrentAppSimulator.LoadListingInformationAsync();

2条回答
我只想做你的唯一
2楼-- · 2019-08-11 23:01

I had same exception. I updated package certificate File (StoreKey.pfx), by creating package with sign in to the windows store. And it fix problem for me.

查看更多
三岁会撩人
3楼-- · 2019-08-11 23:23

System.Exception: Exception from HRESULT: 0x801900CC

That's an expected exception while you are developing your app. The error code is BG_E_HTTP_ERROR_204, 0xCC encodes the HTTP response error code. 0xCC == 204, HTTP error 204 means "No content". Or in other words, the Store server is not aware of your app having any in-app purchases.

This is a chicken-and-egg problem, the server doesn't know about your in-app purchases until after you submitted your app and got it approved. You must test your app with CurrentAppSimuator to debug and test your in-app purchases. The basic how-to guide is here. One important step you must not forget is to substitute CurrentAppSimulator with CurrentApp just before you submit your app for verification.

That your app is already in the Store does not factor in when you added in-app purchases to your new version. The crucial required step is to make the Store server aware of your purchase options. As described by the linked MSDN article, you do this when you submit the app. They will not be effective until your submission is approved.

So, do not panic, you can test your code with the simulator. When you've verified that you got that working, there's little reason to fear this being a problem after you submitted the app, as long as you follow the steps in the MSDN article.

查看更多
登录 后发表回答