Get platform version of Runtime Packages / Update to D365BCAppHelper (and little sign of life)

Allgemein, Business Central, Development, PowerShell , ,

My last post was already quite a while ago. That’s mostly because the work-load right now is kind of bananas. Never thought that there be so much projects in the midst of a pandemic 😅

But at least some small update is there in the meantime, that I can share. Thanks to Kenneth Fuglsangs tweet (and thanks to Chris Blank notifying me) I was able to add another feature to the D365BCAppHelper PowerShell-module.

You might already have stumbled accross the following warning/issue: you want to publish a Runtime package and you receive a warning like the following:

WARNING: The package has been built on a server with a different version than the current server version. Package: 17.0.21485.22158, Server: 18.0.22893.23773.

WARNING: The package has been built on a server with a different version than the current server version. Package: 17.0.21485.22158, Server: 18.0.22893.23773.

Microsoft does not guarantee that a runtime package created for version X will work with a later version Y (see the note in the “Limitations”-section of the Docs-article). Additionally there is this short discussion on Github regarding this section. Packages created for an older version will most likely work anyway for a newer version – but you can’t depend on it.

So, coming back to the tweet from @kfuglsang. The requirement was to get the information for which version a runtime package was created:

And since we saw that the above warning somehow recognizes this, there has to be a way for us to get this info as well, right? A bit of walking through the binaries from the used CmdLets showed that Runtime packages should contain a “EmittedContent.json” file in the “bin” directory. In my example this file starts like this:

{"PlatformVersion":{"Major":17,"Minor":0,"Build":21485,"Revision":22158,"MajorRevision":0,"MinorRevision":22158},"Contents":[{...

So, there we have the necessary info. And to make it easier for you to read it right away, I added a new Command to D365BCAppHelper. Just install/update the module and run the following:

# Install-Module -Name D365BCAppHelper
# Or
# Update-Module -Name D365BCAppHelper -Force

Get-D365BCPlatformVersion -Filename 
C:\run\my\test\MyRuntimeApp.runtime.app

This will only work for runtime packages. I didn’t test it a lot, but against some packages I had on hand and for them it worked. Please report any issues you encounter on GitHub.

I hope this feature might help you. If you can think of any more helpful features in this module don’t hesitate to get in touch 🤗

Leave a Reply

Your email address will not be published.