Debug MPOS (sealed) and CPOS extensions
This article explains how to debug sealed Modern Point of Sale (MPOS) and Cloud POS extensions. It applies to version 10.0.18 and later of the Retail software development kit (SDK).
Note
To debug the Store Commerce app, see Debug Store Commerce extensions using Visual Studio Code
Debug Sealed Modern POS by using Visual Studio 2017
Follow these steps to debug your extension.
Install Sealed Modern POS (MPOS) on the development machine by using the Sealed MPOS installer. The Modern POS (SEALED) installer can be downloaded from https://lcs.dynamics.com/V2/SharedAssetLibrary > Retail Self-service package section.
After installing the Modern POS (SEALED) installer, a desktop shortcut icon will be created to Install or Update POS Universal Windows Platform (UWP) app. Double click the Install or update Retail Modern POS icon on the desktop to install the UWP app. This previous deploys the required backend components and installs the UWP app.
In Microsoft Visual Studio, build your MPOS extension package project (the JavaScript project file [.jsproj file]).
Deploy your MPOS extension package. In Solution Explorer, select and hold (or right-click) the MPOS .jsproj file, and then select Deploy.
Open POS so that the debugger is attached:
- On the Debug menu, select Other Debug Targets > Debug Installed App Package.
- Search for and select Commerce Modern POS.
- Select Start to open the app.
Run and debug Cloud POS
Configure the Cloud POS extension development environment
Follow these steps the first time that an extension package is developed on the machine or if the link is deleted. In the Cloud POS (CPOS) Extensions directory, create a directory symbolic link to the root directory of the extension package.
Make sure that CPOS is deployed on the machine. If it isn't deployed, use the Commerce Scale Unit (self-hosted) installer to deploy it.
Open Internet Information Services (IIS). Select Windows logo key+R to open the Run dialog box, enter inetmgr, and then select OK.
Expand Sites, select and hold (or right-click) RetailCloudPos, and then select Explore.
Select File, and then select Open Windows PowerShell as administrator.
In the Windows PowerShell window, run the following command to open a Windows command prompt.
cmd .
Run the following command to change the current directory to the Extensions root directory.
cd Extensions
Run the following command to create a session variable that has the name of your extension package.
set ExtensionPackageName=Contoso.Pos.Developer.Samples
Note
Replace Contoso.Pos.Developer.Samples with the name of your POS extension package. The name of the extension package must match the name that is specified in ExtensionPackageDefinition in the Commerce runtime (CRT) trigger extension that configures the POS extension package.
Run the following command to create a session variable that has the absolute path of the directory for your POS extension package project.
set AbsolutePathToExtensionPackageProject=%FullPathToPOSExtensionProjectRootDirectory%
Note
Replace %FullPathToPOSExtensionProjectRootDirectory% with the absolute path of your POS extension package project. Here is an example.
set AbsolutePathToExtensionPackageProject=K:\RetailCloudPos\WebRoot\Extensions\ Contoso.Pos.Developer.Samples
Run the following command to create a link from the Extensions directory to the root directory of the extension package project.
mklink /D %ExtensionPackageName% %AbsolutePathToExtensionPackageProject%
Verify that the linked folder for your extension package is created in the directory for the CPOS extension package.
Debug CPOS by using the Microsoft Edge developer tools
- Follow the steps in the Configure the Cloud POS extension development environment section earlier in this article.
- Build your CPOS extension project.
- In Microsoft Edge, open the CPOS website.
- Select the F12 key to open the Microsoft Edge developer tools.
- Set up a workspace that points to the root directory of your CPOS extension package. You have to set up the workspace only the first time that you complete this procedure.
- Make sure that JavaScript Source Mapping is enabled.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for