Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Answered

Debug D365 Retail CPOS / MPOS extensions

(0) ShareShare
ReportReport
Posted on by 70

Hello community,

This question is about development / debugging D365 Retail CPOS / MPOS extension code.
Here is the technical background :

Question n°1:
Does anyone know how can we load the "Pos.Web" project on a cloud hosted DevBox with administrator rights ?
I'm asking this because the only procedure that I found is marked as for DevBoxes without administrator rights.

  • Development:
    • Added a folder in “Pos.Extensions” project
    • Added an extension for the “GetScanResultClientRequestHandler”.
    • Added “manifest.json” file, modified “extensions.json” and “tsconfig.json” files.
    • Compiled the whole solution, everything is OK. 

Question n°2:
How should we debug POS extensions, by pressing F5 or by attaching to process (w3wP or iisexpress) ?

Question n° 3:
Should we put the break points in the .TS files or in the corresponding .JS files generated automatically ?

  • Debugging:
    I have tried debugging both ways, with pressing F5 (Google Chrome), and with attaching to process (w3p3 and iisexpress).
    When use the attach debugger to process, I start the browser and log on to POS first, then attach to process.
    Here are the results: 
    • Debug with F5:
      Everything starts smoothly, browser in POS application and VS in debugger, with break points full red.
      The problem, no matter what I do break points never get hit.
    • Debug with attach to process:
      The symbols for the break points in my extension never get loaded, thus break points never get hit.

Questions n° 4:
Did anyone actually create a CPOS / MPOS extension and debug it with Visual Studio ?
If yes, could you please share some detail on how to achieve this “miracle” ? :-)

Thank you.
Kind regards,
Saso

  • Suggested answer
    Saso GLIGOR Profile Picture
    70 on at
    RE: Debug D365 Retail CPOS / MPOS extensions

    Hi there,

    Here is an update of my initial post, as I managed to resolve pretty much everything.
    The following solution worked for me, which doesn’t mean that it's 100% sure. Don’t hesitate to question.

    Question n°1:

    Does anyone know how can we load the "Pos.Web" project on a cloud hosted DevBox with administrator rights ?
    I'm asking this because the only procedure that I found is marked as for DevBoxes without administrator rights.

    Answer:

    On a freshly deployed environment, when you try to load the “CloudPOS” solution you will probably get the following error:

    7776.pastedimage1571610874586v1.png

    In order to load the "Pos.Web" project, it doesn’t matter if you have or not administrator rights on the DevBox, you should edit the “Pos.Web.csproj” file and replace the tag value of <IISUrl> with the URL of your POS server.

    4762.pastedimage1571610904707v2.png

    You can find it in the LCS details page of your environment => Login => Log on to CPOS.
    After changing this tag value, the project can be loaded.

    So at this point everything is working well.
    If we then try to debug our project by clicking F5, we will be asked to enable debug mode in “Web.config” file, as shown here below.

    6138.pastedimage1571610943250v3.png

    After that, the debugging of the “CloudPOS” solution was impossible for me.
    When I start debugging with F5 or “Attach to process”, I always got the following error:

    7851.pastedimage1571610961506v4.png

    No need to mention, the “MSVSMON.EXE” service was running correctly, so that was not the problem really. I was looking for something else.
    By changing the following in the "Pos.Web" project, I managed to go around this problem, tag value of <UseIIS> from True to False.

    4846.pastedimage1571611217042v5.png

    After these changes you get the following error, which is in fact the one that the Microsoft article starts with:
    https://docs.microsoft.com/en-gb/dynamics365/retail/dev-itpro/cloud-dev-box

    1031.pastedimage1571611266285v6.png

    At this point you can apply the procedure in the above article, which will enable you to start the application with pressing F5 and debug
    Debuging exclusively with Internet Explorer, it does not work with other navigators,

    Question n°2:

    How should we debug POS extensions, my pressing F5 or by attaching to process (w3wP or iisexpress) ?

    Answer:

    CloudPOS:
    I managed to debug my extensions with running the application in debugger mode.
    Press F5 and before doing so I check that the default navigator is “Internet Explorer”.
    The last thing is very important, POS extension break points don’t get hit in any other navigator then “Internet Explorer”.

    ModernPOS:
    I managed to debug my extensions by running the ModernPOS application, and then attaching the debugger to the “iisexpress” process.

    Question n°3:

    Should we put the break points in the .TS files or in the corresponding .JS files generated automatically ?

    Answer:

    Break points in TS files get hit when using the above approach.
    Break points in JS files don’t seem to get hit in POS extensions, no matter the approach.

    Question n°4:

    Did anyone actually create a CPOS / MPOS extension and debug it with Visual Studio ?
    If yes, could you please share some detail on how to achieve this “miracle” ? :-)

    Answer:

    Yes, me, please read myself above :-)

    Kind regards,
    Sašo

  • Verified answer
    Saso GLIGOR Profile Picture
    70 on at
    RE: Debug D365 Retail CPOS / MPOS extensions

    Hi Ololabin,

    Thanks a lot for your answer.
    Yes, you are right:

    • For debuging CRT we attach to w3p3 or iisexpress process, depenging whos is running the application.
    • On POS Side, breakpoints in TS fiels and eventually in Pos.js.

    I have worked out all of the answers on my initial questions.
    Let me summ them up and post them in a usefull manner :-)

    Have a nice day.
    Kind regards.
    Saso

  • Ololabin Profile Picture
    5 on at
    RE: Debug D365 Retail CPOS / MPOS extensions

    Hello Saso Gligor,

    CRT extensions - you need to attach to the w3wP process.

    TS files - you need to press F5. In some cases, breakpoints are not loaded. For that, you need to set a breakpoint in the Pos.js file.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,207 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,923 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans