Starting from Dynamics 365 Business Central 2024 Wave 2 release (more precisely from Business Central version 25.2) Microsoft has introduced the possibility to package and use resources (images, files and more) with your extensions. Just for reference, I wrote about how to use this feature in this post time ago.
To add resources in your extension, you just need to create a resource folder (one or many, with subfolder if you want) and then in the extension’s app.json file you need to declare which folders within your extension’s project contain the resources by using the resourceFolders property:
"resourceFolders": ["Folder1", "Folder2"]
Then, to access those resources from AL code, you can use the NavApp.GetResource method (with its available overloads):
All good…
When working with Dynamics 365 Business Central on-premises, you have essentially two possible ways to publish an app:
Many partners, to better protect intellectual property of their solutions, use this second approach: they create a runtime package for an extension (with Get-NavAppRuntimePackage cmdlet) and publish this package to the Business Central on-premises instance.
Until Dynamics 365 Business Central on-premises version 26.2, if you publish an app containing AL code (so not published as runtime package) and you access an embedded resource with NavApp.GetResource from your AL code, the resource is loaded correctly.
But if you do the same from an extension published as runtime package, NavApp.GetResource will fail and you have an error like the following:
Embedded resources on runtime packages are not supported in Dynamics 365 Business Central with version <= 26.2. If you are on these versions and you need to support using embedded resources from AL, you need to publish the full extension’s package.
Starting fom Dynamics 365 Business Central on-premises version >= 26.3 (and platform >= version 26.0.35604.0) embedded resources are also supported in runtime packages.
Please keep in mind this, in order to avoid spending hours on troubleshooting