Cannot see code from runtime packages when "includeSourceInSymbolFile": true
1. Describe the bug Cannot see code from runtime packages when "includeSourceInSymbolFile": true
2. To Reproduce I started from AL:Go and created a codeunit and a table with messages on different triggers. app.json has this policy:
"resourceExposurePolicy": { "allowDebugging": true, "allowDownloadingSource": false, "includeSourceInSymbolFile": true } I used this command to get the runtime package
Get-NavAppRuntimePackage -ServerInstance $ServerInstance -Name $appname -Version $appversion -IncludeSourceInPackageFile $true -Path $outfile
Then published and installed on a new environment. When downloading symbols there is no code in the package.
3. Expected behavior Code should be included in the symbols of a downloaded runtime package when the package was created with -IncludeSourceInPackageFile $true parameter
4. Actual behavior After the runtime package is published, when downloading symbols the objects are missing the code.
5. Versions:
- AL Language: v9.0.615906
- Visual Studio Code:1.67.1
- Business Central: 20.0.0.0
- List of Visual Studio Code extensions that you have installed: AL Language
This is by design. Runtime packages do not contain AL code. The IncludeSourceInPackageFile parameter only applies to extensions published from VSCode, it does not apply to runtime packages.
https://docs.microsoft.com/el-gr/dynamics365/business-central/dev-itpro/developer/devenv-creating-runtime-packages
Reading the documentation I see: "If you set the showMyCode flag to true when running the Get-NavAppRuntimePackage cmdlet, you can enable debugging and you thereby also allow viewing the source code."
On the Get-NavAppRuntimePackage command documentation: https://docs.microsoft.com/en-us/powershell/module/microsoft.dynamics.nav.apps.management/Get-NAVAppRuntimePackage?view=businesscentral-ps-20
there is a parameter: -IncludeSourceInPackageFile Specifies to include source code in the package.
How can the IncludeSourceInPackageFile parameter not apply to runtime packages if the name of the command is Get-NAVAppRuntimePackage
Oh wait, that's my bad. I misread the original issue, I thought you were using the resource exposure policy only. Sorry, yes. This looks like an issue.
Are you debugging on a docker container or OnPrem/Cloud installation?
You cannot install a runtime package on Cloud. I have tried to debug both in a docker container and OnPrem installation.
We have more customers not able to debug our code in onprem installations because of this issue. Is someone looking into this?
It's in our backlog, but we can't give an estimate on when it will be completed. If this is urgent, I suggest raising a support request through customer support, those get prioritized differently (i.e. quicker) from general issues that we get through github.
This has been fixed through Microsoft Support - Case 2206100010001155 TrackingID#2206100010001155 Cause: Product defect in BC 19.x and BC 20.x
Resolution: Fix provided in BC 19.10 and BC 20.4.