none
Unable to test Store trial mode for UWP app

    Question

  • I've built a UWP app which I would like offer as a trial in the Microsoft Store. As recommended, I'm using the Windows.Services.Store namespace and have added the calls to to check for the trial state and time remaining on the trial per this documentation: https://docs.microsoft.com/en-us/windows/uwp/monetize/implement-a-trial-version-of-your-app

    Now I'm following these instructions to test my code: https://docs.microsoft.com/en-us/windows/uwp/monetize/in-app-purchases-and-trials#testing

    Per the testing instructions, I've published the app to the Store and downloaded it to my local machine. The store tells me that I have xx number of days left on my trial. I launch the app once and close it. Then I open the project in Visual Studio and launch the app for debugging, I get the warning that the app is already installed on the machine, I select "Yes" to continue.

    Then the deployment fails with this error:

    DEP0700: Registration of the app failed. [0x80073CF9] Rejecting a request to register from AppxBundleManifest.xml because the manifest is not in the package root.

    If I uninstall the trial app, then my project will deploy, but the app license that I get back in code says .IsTrial = false, so I don't think this will allow me to actually test the app trial.

    The documentation states: "After you complete these steps, you can continue to update your app's code and then debug your updated project on your development computer without submitting new app packages to the Store.", so it seems like this should work.

    I see that the older namspace, Windows.ApplicationModel.Store offers a license simulator, which could help, but the documentation also states that that is not the recommended namespace.

    Any thoughts on how i can test this trial mode as documented?
    Thursday, April 4, 2019 5:14 PM

Answers

  • I finally got this to work. I suspected that there was something corrupt in the Windows install on my development machine that was causing this not to work as documented. So, I set up a fresh install of Windows 10 on a Hyper-V VM and used remote debugging tools. Every thing worked on that fresh install, as expected. Here's the steps I took:

    1. Create a Hyper-V VM with the version of Windows 10 you want to target and install the VS remote debugging tools.
    2. Code your app to use the Windows.Services.Store namespace features that you need.
    3. Submit your app to the store and set it to be hidden
    4. Once the app is in the store, go to the VM, use the store link to navigate directly to the app in the store
    5. Install the app, open it once and close it.
    6. On your host machine open the VS solution, configure it for remote debugging and point it to the VM.
    7. Launch debugging sessions from your host machine to the VM. When the app launches on the VM it will be running under the context of a valid Store licence, allowing you to debug and change Windows.Services.Store related code as needed.
    Monday, May 6, 2019 8:15 PM

All replies

  • Please check if you open your visual studio in 'Administrator' mode. In general, it will work.
    Friday, April 5, 2019 6:32 AM
  • Doesn't work.
    Friday, April 5, 2019 4:34 PM
  • OK, I restarted my PC and now the app deploys when running Visual Studio as Administrator. However, the license information coming from Windows.Services.Store is not correct. I downloaded it as a trail, yet IsTrial=false. If I open the app listing in the store, it tries to download the app again. So, my deployment is wiping out the installed app and it's license. 

    I'm dumbfounded as to how Microsoft expects us to use the "preferred" Windows.Services.Store namespace and be able to actually debug our code or simulate a license scenario. Should I just update my code to use the older Windows.ApplicationModel.Store? I want to use the "preferred" namespace, but not sure what else to do at this point, as I just want to get my app in the store already. 



    • Edited by rawk1989 Friday, April 5, 2019 8:31 PM
    Friday, April 5, 2019 5:31 PM
  • Anyone have any thoughts on this?
    Wednesday, April 17, 2019 9:49 PM
  • Hi, sorry for the unrelated question. Can see your app is offering a trial, then it will charge single-time or subscription? Having a hard time figuring out what code to use to run subscription after trial in my app.

    Thank you!


    Senior Front End Developer.

    Wednesday, April 17, 2019 11:38 PM
  • @rawk,

    A troubleshoot step is to see if it works on a fresh new computer and also check whether your skuStoreId is empty. And if it does not work, please directly file this issue on Feedback Hub so that a dev support may be able to check it from there. 

    Regards,

    Barry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 22, 2019 5:37 AM
    Moderator
  • I finally got this to work. I suspected that there was something corrupt in the Windows install on my development machine that was causing this not to work as documented. So, I set up a fresh install of Windows 10 on a Hyper-V VM and used remote debugging tools. Every thing worked on that fresh install, as expected. Here's the steps I took:

    1. Create a Hyper-V VM with the version of Windows 10 you want to target and install the VS remote debugging tools.
    2. Code your app to use the Windows.Services.Store namespace features that you need.
    3. Submit your app to the store and set it to be hidden
    4. Once the app is in the store, go to the VM, use the store link to navigate directly to the app in the store
    5. Install the app, open it once and close it.
    6. On your host machine open the VS solution, configure it for remote debugging and point it to the VM.
    7. Launch debugging sessions from your host machine to the VM. When the app launches on the VM it will be running under the context of a valid Store licence, allowing you to debug and change Windows.Services.Store related code as needed.
    Monday, May 6, 2019 8:15 PM
  • @rawk,

    So it seems that you can debug right now but you do not have the right value when calling TrialTimeRemaining property, am I right? Maybe we can end the discussion here and discuss together on your new thread about this problem.

    Best regards,

    Barry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, May 7, 2019 7:27 AM
    Moderator