While developing your own extension on NAV 2018 or “BC under version 15” you have the availability over 2 debuggers: the VSCode debugger and the C/SIDE (or should we call it Windows) debugger. Both serve a somewhat different scenario:
VSCode debugger
You want to run step-by-step through the code of your extension – being AL code – and from there might step into the code that resides in the NAV/BC installation you are programming against. Most probably the C/AL code of the standard application.
C/SIDE debugger
You want to debug a process starting from either the web or window client, most likely because of an error occurring. Chances are big you will hit C/AL code, but also AL code of your extension when you have showMyCode set to true. No way to get this effectively done with the VSCode debugger.
But last week it did not work the way I expected it to do. One of my students of the Opgona Junior Training was expanding his extension on BC 14 with an XML import, using an XMLport. As the BC 14 web client unfortunately does not support the XMLport request page (but does on BC 15), I suggested to use the windows client to easily operate his solution. Running into an issue he wanted to debug and thus could only use the C/SIDE debugger. But whatever he did, the C/SIDE debugger did not show his code. And yes, showMyCode was set to true in the app.json of his extension.
So I posted a tweet asking what was done wrong:
A lot of people stepped in and eventually my former, and ever very helpful, MS colleague Duilio Tacconi came to the rescue:
By adding a hidden setting to your customsettings.config C/SIDE debugger should show AL code:
<add key="ProtectNavAppSourceFiles" value="false" />
And yes, it makes the AL code visible in the C/SIDE debugger.
But the question is why we do need this? Or more precise: since when do we need this? I was quite sure it was working without fine. On NAV 2018, on BC 13 and also on BC 14. Just checked on a docker installation of BC 14.1 and indeed working as I expected, and wanted.
Allain Krikilion apparently had noticed the chance prevously this year:
Did not make a full check but 14.7 clearly has this issue.