0

In a Winforms app converted into a uwp app (Centennial) - how can the app check for the licensing status?

In UWP I can use CurrentApp.LicenseInformation but that's under Windows.ApplicationModel.Store, and I can't find that in the Add Reference to Winforms.

Stefan Wick MSFT
  • 13,600
  • 1
  • 32
  • 51
ispiro
  • 26,556
  • 38
  • 136
  • 291

1 Answers1

1

To be able to use the WinRT APIs from your Winforms project, please add a reference to this WinMD reference: C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Windows.winmd from your Winforms project. I'd also encourage you to take a look at the Desktop Bridge samples on GitHub: https://github.com/Microsoft/DesktopBridgeToUWP-Samples

Btw, since you asked the Store licensing question, have you already filled up this form: https://developer.microsoft.com/en-us/windows/projects/campaigns/desktop-bridge yet? Once you fill up the form, someone from MSFT will contact you to work with you further regarding further help on the onboarding to the Store process...Let me know if you are stuck there...

  • About the samples - they seem to assume using the app converter. Since I'm not using MSI - I can't use that. They don't explain, for example, what you wrote in your answer. (They might even assume VS15.) – ispiro Sep 20 '16 at 20:51
  • Thanks. But will that reference be needed on the target machine? – ispiro Sep 20 '16 at 21:01
  • No, the WinMD is just like a header file, it contains the definitions, so that you can write code....The implementation is not in the winmd. This is one link you can use as reference: https://msdn.microsoft.com/en-us/library/windows/apps/hh755822.aspx – Prashant H Phadke - MSFT Sep 21 '16 at 21:38
  • Thanks. Bounty awarded. Also, since you seem to know your way around "Centennial", perhaps you know how to [Get file paths for files in Centennial app](http://stackoverflow.com/questions/39625644/get-file-paths-for-files-in-centennial-app) ? – ispiro Sep 21 '16 at 21:41
  • And to answer the Store licensing question, you can use the new Windows.Service.Store namespace: https://msdn.microsoft.com/library/windows/apps/windows.services.store.aspx which will enable access to much richer licensing semantics. But, again for onboarding your app to the Store, please start with the form above. – Prashant H Phadke - MSFT Sep 21 '16 at 21:42