Dynamics 365 Business Central on-premises: accessing embedded in-app resources from runtime packages.

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… 😉

The problem:

When working with Dynamics 365 Business Central on-premises, you have essentially two possible ways to publish an app:

  1. Directly publish your app with AL code (output of a traditional compilation) with Publish-NavApp + Sync-NavApp cmdlets.
  2. Generate a runtime packages that don’t contain AL code, but only the final artifacts used by the server at runtime. 

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.

What happens when accessing resources embedded in an extension from AL?

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 😜

Original Post https://demiliani.com/2025/08/27/dynamics-365-business-central-on-premises-accessing-embedded-in-app-resources-from-runtime-packages/

0 Votes: 0 Upvotes, 0 Downvotes (0 Points)

Leave a reply

Join Us
  • X Network2.1K
  • LinkedIn3.8k
  • Bluesky0.5K
Support The Site
Events
August 2025
MTWTFSS
     1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
« Jul   Sep »
Follow
Search
Popular Now
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...