Debugging Cloud sandbox

SourceCode is shown from BC19 

Source code can be viewed from BC19 and forward.

SourceCode not shown in BC13..BC18

Mobile WMS extension has it´s source code hidden.

This is achieved by setting the ShowMyCode property to “false” in the app.json file in the app-file deployed to AppSource.

Before debugging can be started, the partner needs to create a sandbox copy of the production environment containing the error to troubleshoot.


Debug with the request property set to “Attach”

It´s possible to debug an error from a webservice call by setting the Request property to “Attach”.

This will allow you to attach debugger from VS Code to a sandbox environment without deploying any app file.


If the error comes from within standard BC code, the debugger will catch the error and show the call stack and the specific line of code.

It´s possible to navigate through the call stack but only content from the standard BC code is visible. All code form within Mobile WMS will not be visible.


If the error comes from within the Mobile WMS code, the error will not be shown and the debug process/connection from VS Code will be terminated when the error occurs.

You will not be able to see the call stack or any code.


Debug with the request property set to “Launch”

You can deploy a copy of the specific app version manually from VS Code to the sandbox. You need to manually change the ShowMyCode property to “true” and update the launch.json with endpoint information.

This will allow full debug features with all code visible and the option to use breakpoints.


Please note:

After you deploy the App from VS Code (Scope = Development), it´s no longer possible to add or update the App from AppSource for that specific sandbox environment.

(This should be OK – because the sandbox was only created for the purpose of debugging and should be deleted afterwards)

 

Username must match  

You must Log in to Mobile WMS, with the same Username as VS Code Publish/attaches to Sandbox


Hint:

In VS Code you can search for the specific version TAG and create a local branch from there. Open a TAG just like you open any other branch in VS Code.


Example of Launch.json file for “Attach” debugging:


{

    "version": "0.2.0",

    "configurations": [

        {

            "name": "Microsoft cloud sandbox",

            "request": "attach",

            "type": "al",

            "environmentType": "Sandbox",

            "environmentName": "NameOfYourSandbox",                      

            "breakOnError": true,  

            "breakOnNext": "WebServiceClient",          

            "enableLongRunningSqlStatements": true,

            "enableSqlInformationDebugger": true,

            "tenant": "taskletfactory.onmicrosoft.com" or "YourCompany.com"

        }

    ]

}



Example of Launch.json file for “Launch” debugging:

{

    "version": "0.2.0",

    "configurations": [

        {

            "name": "Microsoft cloud sandbox",

            "request": "launch",

            "type": "al",

            "environmentType": "Sandbox",

            "environmentName": " NameOfYourSandbox ",            

            "breakOnError": true,

            "launchBrowser": true,

            "enableLongRunningSqlStatements": true,

            "enableSqlInformationDebugger": true,

            "tenant": "YourCompany.onmicrosoft.com" or "YourCompany.com"

        }

    ]

}

See also