Debugging Business Central

BigFanBigFan Member Posts: 2
Hi experts,

We have a question regarding debugging. As I can not find a proper answer to my question I am asking it here, hoping to get an answer.

We are working with Business Central version 17.4 onprem.
We are wondering what the best way of debugging is when we want to debug our customers production database?

We know we can attach a debug (or snapshot) configuration to the Launch.json but this will only trigger the debugger when an error occurs (or with the snapshots it will only record the snapshot when an error occurs).

On the Customers server we do have Visual Studio Code installed.
We deploy our solution (app) via powershell scripts and we have the property ShowMyCode set to False as we do not want other parties being able to download our source code.
So on the Customers server we don’t have the possibility to set breakpoints in code to trigger the debugger when executing the process we would like to debug.

So we were wondering what the best way is to debug a process in the Customers database that does not throw an error.

Thanks for the advice.

Answers

  • irasoelbaksirasoelbaks Member Posts: 119
    edited 2021-03-10
    I don't know what 'throw an error' means literally. In VS Code you have the option to debug without publish. Is this what you were looking for?
    w5xkiqz2rggo.png
  • BigFanBigFan Member Posts: 2
    Hi, I meant that we are not able to set breakpoints so we need to have an error to debug.
    We know about the functionality to debug like you mentioned. However as we do not have our code at the Customers server available we are not able to set breakpoints.
  • irasoelbaksirasoelbaks Member Posts: 119
    edited 2021-03-10
    Good question in fact! I guess you need to change the extension with one that has ShowMyCode true I you need to debug. With PS this should be quite easy IMO. And please take note of this info from MS Docs:

    "Even though showMyCode is set to false, you will still be able to view that code if an extension is deployed through Visual Studio Code, as opposed to deploying using a cmdlet or via AppSource."

    All relevant info can be found on https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-security-settings-and-ip-protection
Sign In or Register to comment.