Power Community

Power Community

.NET Framework or .NET Core ALC.exe? Which one to choose.

With Dynamics 365 Business Central, it is quite common to compile using the native compiler ALC.exe through PowerShell scripts or command line. This is mainly used within CI/CD implemented as development lifecycle.

Sometimes we have seen, typically with very large extensions, that VS Code compilation runs successfully while using ALC.exe it ends into an unhandled OutOfMemory exception, like the one below or similar (NOTE: this is just an example)

Compilation ended at ’16:05:11.460′.

 

System.OutOfMemoryException: Exception of type ‘System.OutOfMemoryException’ was thrown.

   at System.IO.File.InternalReadAllBytes(String path, Boolean checkHost)

   at Microsoft.Dynamics.Nav.CodeAnalysis.RelativeFileSystem.ReadBytes(String path) in D:a1ssourceProdMicrosoft.Dynamics.Nav.CodeAnalysisCompilationRelativeFileSystem.cs:line 23

   at Microsoft.Dynamics.Nav.CodeAnalysis.Translation.LanguageFileExtracting.ExtractXliff12(IFileSystem fileSystem, String filePath, LanguagesMetadata languagesMetadata, DiagnosticBag diagnostics, HashSet`1 lang

uagesAdded, List`1 languagesAndFiles) in D:a1ssourceProdMicrosoft.Dynamics.Nav.CodeAnalysisTranslationMetadataExtractionLanguageFileExtracting.cs:line 91

 

Not that many know that there are 2 very different ALC.exe. These 2 good brothers, are both released within marketplace VSIX package:

.NET Framework ALC.exe

  • Currently based on .NET 4.8
  • Typically stored in bin folder (e.g. C:Usersdtacconi.vscodeextensionsms-dynamics-smb.al-8.4.586670bin )
  • WORSE in handling resources (memory and processor)

.NET Core ALC.exe

  • Currently based on .NET 5
  • Typically stored in binwin32 folder (e.g. C:Usersdtacconi.vscodeextensionsms-dynamics-smb.al-8.4.586670binwin32 )
  • BETTER in handling resources (memory and processor)

 

To summarize, then, if you have CI/CD implemented or simply you are in need to use ALC.exe, Microsoft strongly and warmly recommends using the .NET core based ALC.exe from win32 folder. Also, worth mentioning to use the one from the latest and greatest marketplace VSIX, where possible.

- Advertisement -spot_img

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement -spot_img

Latest News

- Advertisement -spot_img

More Articles Like This

- Advertisement -spot_img