microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
737 stars 243 forks source link

GetLatestSupportedRuntimeVersion with altool returns incorrect runtime version #7786

Closed Arthurvdv closed 2 months ago

Arthurvdv commented 3 months ago

1. Describe the bug When executing altool.exe GetLatestSupportedRuntimeVersion 24.0 it returns the value 13.1, where I would expect 13.0.

image

2. To Reproduce

  1. Download the 'AL Language extension for Microsoft Dynamics 365 Business Central' version 13.1.1065068 from the marketplace.
  2. Navigate to the folder 'extension\bin\win32'
  3. Execute the command altool.exe GetLatestSupportedRuntimeVersion 24.0

3. Expected behavior I would expect the result to be 13.0 instead of 13.1, based on the documentation: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-choosing-runtime#currently-available-runtime-versions.

4. Actual behavior

5. Versions:

Final Checklist

Please remember to do the following:

vlnzr commented 2 months ago

I have a problem regarding this as well: image BC23 versions above 23.6 do not work with error message Unknown platform version. altool.exe version: 14.0.15.27930+87ac3e913f0b2d036867db453a0d36ec8ae690fb

qutreson commented 2 months ago

The command GetLatestSupportedRuntimeVersion is tailored for getting the runtime version linked to a specific version in SaaS and doesn't cover OnPrem. From BC 22.0, we are using the same platform (and then runtime version) in SaaS for all minors of a given major release. As a consequence 24.0 in SaaS supports runtime 13.1, while OnPrem it supports 13.0 only. Before BC 22, the runtime versions would be the same OnPrem and in SaaS. The behavior of GetLatestSupportedRuntimeVersion for BC 22, 23, and 24 was corrected recently for SaaS because it was causing some incorrect AppSource submission failures performing this platform/runtime consistency check.

The documentation mentioned in the issue specifies the mapping of runtime versions for OnPrem releases, but doesn't mention it. This is also something we should update to cover both OnPrem and SaaS.

Being tailored for SaaS also explains why platform versions 23.6 and higher are not known since those versions only exist OnPrem. This part hasn't changed as part of the recent fix though and minors *.6 and higher were never supported by this command.

The current behavior is then by design, but can you let us know more about what your scenarios? Based on your input, we could then discuss whether a similar command makes sense for OnPrem, or if another solution could be used.

vlnzr commented 2 months ago

Thank you for clarification!

I am using BCContainerHelper's function Run-AlCops. This includes a step to run GetLatestSupportedRuntimeVersion which then obviously throws the error, that 23.8 is not available. I will raise a ticket in their repository about this.

Arthurvdv commented 2 months ago

@qutreson Thank you for taking the time to elaborate on this, much appreciated!

I didn't realize this was tailored for SaaS, where I mistook the results that these should also be valid for On-Prem. I'm going to close this issue here, as it result is indeed correct.

Based on your input, we could then discuss whether a similar command makes sense for OnPrem, or if another solution could be used.

I'm using the inner workings of this method in the custom code analyzer (LC0033 · BusinessCentral.LinterCop (github.com)) to inform when a runtime property in the app.json is explicitly set and falling behind compared with the application/platform version.

It would be great to also have a On-Prem compatible version of this the future.