top of page

Set Model Versions error

Here is a small tip for solving a particular error when we configure a pipeline to do the automatic build on an Azure machine. We will not go into the details of the assembly of the pipeline. If you need help you can refer to a very useful link that has been of great help to me:


It is possible that we will find the following error when executing the pipeline:

##[error]Unable to find type Microsoft.Dynamics.ApplicationPlatform.Instrumentation.AXDeveloperALMEventSource].

The image of the error would be this:

This error is because we have disabled the Prepare for build step. In addition to backing up the AOSServics and the database (which is why we may have disabled the step), this step also preloads all the libraries that will be used during the Build. If we disable it, the agent will not have these libraries and will fail.

Therefore, the solution is to enable the Prepare for build step. And if you want it not to do the backup, open the PrepareForBuild.ps1 file in the C:/DynamicsSDK/ folder and comment the lines corresponding to the backup (line 696):


# Create packages backup (if it does not exist).
$NewBackupCreated = Backup-AX7Packages -BackupPath $PackagesBackupPath -DeploymentPackagesPath $DeploymentPackagesPath -LogLocation $LogLocation

# Restore packages backup (unless a new backup was just created).
if (!$NewBackupCreated)
{
    Restore-AX7Packages -BackupPath $PackagesBackupPath -DeploymentPackagesPath $DeploymentPackagesPath -LogLocation $LogLocation -RestoreAllFiles:$RestorePackagesAllFiles
}
    
if (!$DatabaseBackupToRestore)
{
    $DatabaseBackupPath = Get-BackupPath -Purpose "Databases"
    Backup-AX7Database -BackupPath $DatabaseBackupPath
}
else
{
    # Restore a database backup (if specified).
    Restore-AX7Database -DatabaseBackupToRestore $DatabaseBackupToRestore
}

I hope you find the TIP useful!


bottom of page