Manage third-party models and runtime packages by using source control
Customers that work with solutions from third parties might receive different solution artifacts to use in their solution. Typically, these artifacts are distributed as code (in the form of models) or binaries (in the form of deployable packages). In some cases, third parties might provide some parts of their solution as code and other parts as a binary.
This topic outlines a recommended strategy for managing, distributing, and deploying these third-party solutions.
Models from third parties
Any source code that is received from third parties must be compiled into a binary and included in a deployable package. Models should be installed on a development virtual machine (VM) and added to source control. From there, the build VM can pick up the source code, build it, and include it in a deployable package. Other developers can just synchronize the model from Microsoft Visual Studio Team Services (VSTS) to their development VMs. They don't have to manually install it.
For information about how to install a model on a development VM, see Export and import a model.
After you install the model, follow these steps to add the new model to source control.
In Microsoft Visual Studio, on the Dynamics 365 menu, click Model Management > Refresh Models.
Open Application Explorer by clicking View > Application Explorer.
Right-click the AOT root node, and then click Model view.
In the list of models, find the new model that you installed. Make a note of the name of the package that contains the model. The package name appears in parentheses after the model name. For example, in the following illustration, the Tax Books, Tax Engine Configuration, and Tax Engine Interface models all belong to the package that is named TaxEngine.
Open Source Control Explorer by clicking View > Other Windows > Source Control Explorer.
Navigate to the metadata folder that is mapped on this development VM, such as MyProject/Trunk/Main/Metadata.
In the metadata folder, find the folder for the package that contains the new model. Right-click the package folder, and then click Add Items to Folder.
In the Add to Source Control dialog box, select the Descriptor folder and the folder that has the name of the model. Some models may also contain referenced DLLs in the bin folder. If these exist you'll need to also include the approriate DLL files from the bin folder. Once all files have been selected, click Next.
Review the items that will be added, and then, when you're ready, click Finish.
Open the Pending Changes window from the Team Explorer pane or by clicking View > Other Windows > Pending Changes.
Review the changes, enter a check-in comment, and then click Check In.
Deployable packages from third parties
Deployable packages from third parties can be manually installed on a development VM, and the installed artifacts can then be added to source control. Then, by synchronizing their local workspace, other developers can receive the runtime package on their VMs without having to install the deployable package. The build process on the build VM will help guarantee that the runtime packages for any extensions or other dependencies are available on the build VM. In Platform update 6 and later, by default, these runtime packages will be included in the final deployable package that is created from the build VM. For more information, see the Deploying third-party code section later in this topic.
For information about how to install a deployable package on a development VM, see Install a deployable package.
Don't install a software deployable package directly on the build VM. Use source control as described in this topic. Only binary updates should be installed on build VMs.
After you install the deployable package on a development VM, follow these steps to add the runtime package to source control.
- Open Source Control Explorer by clicking View > Other Windows > Source Control Explorer.
- Navigate to the metadata folder that is mapped on this development VM, such as MyProject/Trunk/Main/Metadata.
- Right-click the Metadata folder, and then click Add Items to Folder.
- In the Add to Source Control dialog box, double-click the folder that has the package name that you want to add to source control.
- Select all the folders except XppMetadata and Descriptor, if they exist, and then click Next.
- On the next page, on the Excluded items tab, select all files by clicking one of the files and then pressing Ctrl+A. At the bottom of the selection window, click Include item(s). When you're ready, click Finish.
- Open the Pending Changes window from the Team Explorer pane or by clicking View > Other Windows > Pending Changes.
- Review the changes, enter a check-in comment, and then click Check In.
Deploying third-party code
Because the models and runtime packages are in source control, other developers who use other development environments can just synchronize the models and packages to their workspace by using the Get latest feature of source control.
As of Platform update 4, the automated build process will also pick up the runtime packages. Therefore, dependencies in packages that are built will be resolved correctly. This feature is also available for Platform update 3 and Platform update 2 through a hotfix.
In Platform update 6, the build process will include this runtime package in the final deployable package. This allows customers to take the deployable package from the build and have one package to deploy to their environments. The one package includes both custom solutions and all the third party solutions.