I'm Joris "Interface" de Gruyter. Welcome To My

Code Crib

Including ISV Binaries in Your Package

Jan 18, 2021
Filed under: #daxmusings #bizapps

Many ISVs supply their Dynamics 365 Finance / Supply Chain solutions in a deployable package, which only contains binaries. With the current enforcement (“all-in-one package”) of a long-standing best practice to deploy all code together all the time, some customers are only now faced with figuring out how to “repackage” an ISV’s binaries into their own package. In this post I will outline a few gotchas in addition to the official documentation, for both the legacy build pipeline and the new build pipeline. You can also watch a quick overview video I made here on YouTube.

The ability to include a binary package when generating a deployable package in build automation was introduced several years ago in Platform Update 6 (yes, six). Essentially it requires you to install the deployable package on a dev machine, and then check the binaries into source control. For most customers this will be all that is required as the build will pick up the binaries from there. The process is outlined in the documentation here: Manage third-party models and runtime packages using source control.

There are a few caveats that are very important, and I’ve seen quite a few developers run into these issues:

  1. As outlined in the documentation (step6), Visual Studio defaults to excluding certain binary files from going in to source control. When adding the files, ALWAYS ensure you check the Excluded Items tab and include all the files! Once checked in, you can double check by going to the web site for your Azure DevOps project, find the code repository and count the amount of files in the package’s folder and subfolders to ensure nothing is missing.

Screenshot of excluded items list

Screenshot of now empty excluded items

  1. When using the legacy build pipeline on the build VM, if your build pipeline was created before Platform Update 6, you may have to manually change the pipeline definition to instruct it to include any “binary packages”. Newer pipelines have a variable for the pipeline that can turn this on or off, but you can just add “-IncludeBinaries” to the arguments list. Make sure there is a space between the previous argument (on old definitions this is probably “-Verbose”) and the hypen (-).
  2. When using the new build pipeline, you need to explicitly provide the path and name of this package to be included. By default, the generate package step only looks at the folder where the compiler outputs binaries it’s building, and the ISV binaries will of course not be compiled. (See note below). The best course of action is to just add another line to the search pattern that explicitly reference the ISV package folder. As a sidenote, you can also use this to exclude packages. The below example includes everything being built in the binaries folder, it includes “SomeISV” package from source control, and it excludes all packages ending in “Tests”. For more information on advanced filtering in Azure DevOps, review the Azure DevOps file matching documentation.

Screenshot of package creation search list

There has been some confusion with the new build pipeline, and this is due to a bug. The sample pipeline has a script that copies all /bin/* contents to the compiler output. This was intended for any DLLs you may be consuming from X++ and have checked into source control, to ensure they are copied to the compiler output folder. However, this also copies any X++ binaries, but ONLY the /bin/ folder. This results in your ISV binaries being packaged up (since it was copied to the folder where packaging can find it), but because it only copied /bin/ it will be missing reports, labels, and other web resources! 10.0.17 (PU41) copies X++ dependencies (DLLs) during the msbuild compilation (from the targets file, for those interested), eliminating the need for the script. I encourage everyone to remove the copy step from the pipeline once you are on 10.0.17/PU41 or higher and ensure any ISV that need to be packaged are explicitly referenced in the create package step, as explained above. The copy script step will be removed from the pipeline sample once 10.0.17/PU41 is generally available.

Check out the YouTube video for a quick runthrough of all these steps.

 

There is no comment section here, but I would love to hear your thoughts! Get in touch!

Blog Links

Blog Post Collections

Recent Posts