D365 apply updates failed – package deployment failed – Dynamics 365 for finance and operations

Issue:

Few times we came across the issue of failing of D365 apply updates or package deployment failed at the step of DevTools.

Resolution:

To resolve the issue follow below steps:

  1. Download the package if not downloaded
  2. Unblock the downloaded package Zip file before extracting
  3. Extract the the package zip file
  4. Navigate to the DevToolsService/Scripts folder in the extracted package folder
  5. Find the the file Microsoft.Dynamics.Framework.Tools.Installer
  1. Double click on the file and install the extension for VS2019

  1. Once extension installation complete resume the package deployment.

Please feel free to comment if you’re facing any issue. We will try our best to help you solve the issues.

D365 Visual studio set default model for new projects

To set default model for new projects in visual studio update the below configuration with your model name

C:\Users\user account\Documents\Visual Studio Dynamics 365Screen Shot 2021-11-23 at 11.24.26 am.png

Edit the file in the notepad and search for default model for new projects node

Screen Shot 2021-11-23 at 11.27.49 am.png

Replace the model name in this case it “Fleet management” with your model name

Uninstall a deployable package from sandbox(UAT) environment or production- Dynamics 365 for Finance and Operations

Scenario: Sometime we need to uninstall a deployable package from the UAT or Production environment.

 

Solution:

Below are the steps that need to be performed to uninstall a package.

 

  • Create a deployable package using visual studio or Build server
  • Do not extract the deployable package that is in ZIP folder (If you extract the zip folder you will face issue invalid HotfixInstallationInfo.xml file)
  • Just open the deployable package zip folder
  • Go to Deployable package zip folder -> AOS service -> Scripts folder
  • create a text file name ‘ModuleToRemove’
  • Write the module name to be removed in the the ModuleToRemove file

Screen Shot 2019-11-23 at 9.10.48 PM

 

  •  If you have multiple models to remove then write mode name per line as below
    • Model1
    • Model2
    • Model3
  • Note: In multiple models removing write the models name in sequence as per dependency sequence
  • Go back to main zip folder and find the file HotfixInstallationInfo.xml ,copy the file to some other location and edit the file like below

<MetadataModuleList>
</MetadataModuleList>

 

<AllComponentList>
<ArrayOfString>
</ArrayOfString>
</AllComponentList>

  • Edit the file should be same as above.
  • Copy and replace the HotfixInstallationInfo.xml file in the deployable folder
  • upload the file in the asset library and apply the package to the UAT environment first if applied successfully then apply to the production environment.

 

Please leave comments if you are facing any issue.

 

 

 

How delete a specific model/package? Uninstall deployable package. Microsoft Dynamics 365 for Finance and Operations

Sometimes we need to delete the model and deployable package from the dev environments.

 

Model Deletion:

use Modelutil.exe to delete the model file from the packages local directory.

 

Package installation or deletion:

 

  1. Stop IIS (kill the IIS worker process from the task manager)
  2. Stop batch job DynamicsAXBatch job
  3. Delete the package folder located on C:\ or K:\AosService\PackagesLocalDirectory (make sure folder completely deleted)
  4. Open VS Dynamics -> Model Management -> Refresh models

 

 

 

Models Export and Import: Dynamics 365 for Finace and Operations

Scenario:

Export model from one dev environment to another dev enviornment

Steps to perform:

  1. Export model from enviornment using command prompt
  2. Import Model in another enviornment using command prompt
  3. Resolve conflicts
  4. Complete build of models and Synchonization of Database

 

Export Model:

Export the model using utilily name ModelUtil.exe located in the below path

K:\AosService\PackagesLocalDirectory\Bin

K:\ Drive can be varrried for local VM C:\ or J:\ 

Command:

ModelUtil.exe -export -metadatastorepath= [path of the metadata 
store] -modelname=[name of the model to export] -outputpath=[path 
of folder where model file should be saved]

 

Example:

ModelUtil.exe -export -metadatastorepath= K:\AosService\PackagesLocalDirectory -modelname=D365FnOModel -outputpath=C:\Users\Userf3d496631\Desktop\US\devmodelsbackup

Screen Shot 2019-09-08 at 4.47.49 PM

 

Import model:

To install or import a model file use below code

ModelUtil.exe -import -metadatastorepath=[path of the metadata store 
where model should be imported] -file=[full path of the file to 
import]

Example:

ModelUtil.exe -Import -metadatastorepath= K:\AosService\PackagesLocalDirectory -file=C:\Users\Userf3d46296631\Desktop\US\devmodelsbackup\D365FnOModel

Screen Shot 2019-09-08 at 4.59.11 PM.png

 

Delete a Model:

If model already exists in the destination environment. Delete the model using modelutility.exe

ModelUtil.exe -delete -metadatastorepath=[path of the metadata store]
 -modelname=[name of the model to delete]

Example:

ModelUtil.exe -Delete -metadatastorepath= K:\AosService\PackagesLocalDirectory -modelName=D365FnOModel

Screen Shot 2019-09-08 at 5.02.35 PM.png

 

Resolve the conflicts after importing:

 

Screen Shot 2019-09-08 at 5.04.05 PM.png

 

Build and sycnhronize:

after resolving all the conlicts build the model(all models would be better but it will take long time) and synchronize the database