Share via

Does Microsoft allow the sample code at the link to be used today?

technoway 241 Reputation points
2023-02-05T06:52:48.0733333+00:00

If I write an app with an in-app purchase based on code at the link below, and the code is bundled in an MSIX installer, may it be in the Microsoft Store?

Store sample
https://learn.microsoft.com/en-us/samples/microsoft/windows-universal-samples/store/

I know that might seem an odd question. I ask that because previously I coded an app with an EXE installer, and the page for EXE installers specifically stated how to do in-app purchased in the Microsoft Store. Then later, I was told that apps with EXE installers could no longer use Microsoft Windows.Services.Store code. This was apparently a change Microsoft made after I joined the Microsoft developer program.

I recently heard something about UWP applications no longer being supported? I'm not sure I understood the context. I don't know much about UWP applications. I think they're apps that use XML to specify the user interface.

I don't want to develop code if I cannot put it on the Microsoft Store.

Note, this is the only code I have found that handles Windows.Services.Store that I can get to compile and link with Visual Studio 2022 Community Edition.

I have not yet tried to put the code ins a C# Windows Forms application. I'm not sure how much this is tied to UWP.

If this code cannot be used, I might have to install Visual Studio 2019 Community Edition.

Windows for business | Windows Client for IT Pros | User experience | Other
Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.

0 comments No comments

Answer accepted by question author

Limitless Technology 45,241 Reputation points
2023-02-06T15:38:21.1333333+00:00

Hi. Thank you for your question and reaching out. I’d be more than happy to help you with your query

Yes, you are able to submit an app with in-app purchases using the code found at the Microsoft Store link. The in-app purchase should adhere to Microsoft's Store Policies and Guidelines, and the code should be correctly packed in the MSIX installer. Additionally, ensure sure the in-app purchase has been thoroughly tested and functions as expected.

If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2023-02-06T06:02:17.7033333+00:00

    Hello,

    Welcome to Microsoft Q&A!

    Yes, exe apps are not could use APIs from Windows.Services.Store NameSpace directly. If you want to develop a WinForms app with in-app purchase and publish it to the store. You will need to use Windows Application Package Project(WAPP) to package your Winform app into a MSIX app which is also as known as Desktop Bridge. Then you could use APIs from Windows.Services.Store NameSpace in your app.

    To package your app use desktop bridge, please check this: Set up your desktop application for MSIX packaging in Visual Studio.

    To enable in app purchase in desktop bridge app: Using the StoreContext class with the Desktop Bridge

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.