Export and import a model
Model files let you distribute models to customers and partners, and can be installed in development environments. They are key components of a Lifecycle Services (LCS) solution. Model files contain a model descriptor file, metadata, source code, and referenced .NET assemblies (when applicable). This article describes how to export a model into a model file, install a model file, and delete a model in a development environment.
Export a model into a model file for distribution
To export an existing model into a model file, use the ModelUtil.exe tool and the -export directive. This tool is located in the packages bin folder (typically, c:\packages\bin or i:\AosService\PackagesLocalDirectory\bin).
ModelUtil.exe -export -metadatastorepath=[path of the metadata store] -modelname=[name of the model to export] -outputpath=[path of the folder where the model file should be saved]
ModelUtil.exe -export -metadatastorepath=c:\packages -modelname="FleetManagement" -outputpath=c:\temp
The preceding example creates an .axmodel file under c:\temp. Typically, you then upload the model file to the Asset Library of the customer project or the Microsoft Dynamics Lifecycle Services (LCS) solution project.
Install a model in a development environment
To install a model file in a development environment, use the ModelUtil.exe tool and the -import directive.
ModelUtil.exe -import -metadatastorepath=[path of the metadata store where model should be imported] -file=[full path of the file to import]
If the model already exists in your development environment, you must first delete it by using the -delete directive.
ModelUtil.exe -delete -metadatastorepath=[path of the metadata store] -modelname=[name of the model to delete]
If you install a model on a development environment that contains customizations to that model (in a higher-layer), you may have to resolve code or metadata conflicts. You can use the development tools to create a project that groups all items that have conflicts.
- Under Dynamics 365 **> **AddIns, click Create Project from Conflicts.
- In the dialog box, select the model to check for conflicts. This is the model that contains customizations to elements in the newly installed baseline model.
- Click Create project. A project is generated that contains only the elements in that model that have conflicts.
- Open the designer for the conflicting element to view and resolve conflicts by using the tools that are provided.