Unable to test Store trial mode for UWP app

0

I've built a UWP app which I would like offer as a trial in the Microsoft Store. I've added the calls to the Store API 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 this warning: enter image description here I click "yes".

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.

Any thoughts on how i can test this trial mode?

UPDATE: I want to clarify that I can debug the app I've downloaded from the Store by attaching to the process as answers have suggested, but that is not what I'm looking for, as it's not reasonable to resubmit to the Store every time need to make changes to the code.

The Microsoft documentation that I linked to (second link) specifically states that I should be able to run, debug and change code regarding the Store API via Visual Studio...

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.

My goal is to get this debugging solution working as documented.

uwp
asked on Stack Overflow Apr 2, 2019 by Scott • edited Apr 2, 2019 by Scott

4 Answers

0

This can be done by debugging an installed app. Essentially, you will have the trial version of your app, and debug it with visual studio and be able to debug your trial related functions.

Hope it helps.

answered on Stack Overflow Apr 2, 2019 by Olivier Samson
0

So what you need are the PDB symbol files for your store version of the app... If you've submitted your app and it's already in the store you can download the PDB symbol files from the developer dashboard. Then you'll need to configure visual studio to locate the symbol file and attach your debugger to a deployed app.

If you built the app locally in release mode- you'll find your PDB symbol files in the build folders.

You don't deploy or run your app from visual studio! You run your app and attach visual studio to the process. You need to ensure your are generating and uploading PDB symbol files for your app... You'll see this check box in your "Create App Package" window.

enter image description here

https://docs.microsoft.com/en-us/visualstudio/debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger?view=vs-2019

Also you can use the directions in the link you have- use this"

"If your app uses the Windows.ApplicationModel.Store namespace, you can use the CurrentAppSimulator class in your app to simulate license info during testing before you submit your app to the Store. "

answered on Stack Overflow Apr 2, 2019 by visc • edited Apr 2, 2019 by visc
0

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.
answered on Stack Overflow May 6, 2019 by Scott • edited May 6, 2019 by Scott
-1

I also faced this issue in my previous developing. Please try to open your visual studio in administrator mode. With this way, I can deploy it successfully.

The steps: Start -> right click 'visual studio' -> More -> Run as administrator.

answered on Stack Overflow Apr 4, 2019 by Xie Steven

User contributions licensed under CC BY-SA 3.0