I have 2 cloud-hosted Dev boxes.
I have a build definition that is using the default agent pool on Dev box (1).
I have another build definition using the default agent pool on Dev box (2) which is set up for Retail.
Both these boxes point to the same branching for X++ so that I can just do a get latest if I did a change on the one. This is temporary because I need to continue developing on X++ for D365FO (1) and create deployable packages while starting to develop for Retail as well on (2).
The build definition works fine for (1).
Agent pool = Default
Get source = Type Map and server path $/Dynamics 365/Trunk/Main

For (2) I duplicated the build definition used by (1) and added Retail steps. When I ran this build, it fails with:
****
Resolve-Path : Cannot find path 'C:\DynamicsSDK\VSOAgent\_work\2\s\Metadata' because it does not exist. At C:\DynamicsSDK\UpdateModelBuildNumbers.ps1:65 char:23 + $BuildMetadataDir = Resolve-Path -Path $BuildMetadataPath + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (C:\DynamicsSDK\...rk\2\s\Metada ta:String) [Resolve-Path], ItemNotFoundException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.Resol vePathCommand
****
I found the link below that references this error.
https://community.dynamics.com/ax/f/microsoft-dynamics-ax-forum/240139/unable-to-create-the-continuous-build-using-vsts-and-lifecycle-services
However I do have models and descriptor files checked in under $/Dynamics 365/Trunk/Main.
Build definition set up for (2):
I used this document to help me with the setup: docs.microsoft.com/.../integrate-retail-sdk-continuous-build
Agent pool = Default
Get Sources: Type Map with source path $/Dynamics 365/Trunk/Main
Type Map with source path $/Dynamics 365/Trunk/RetailSdk-Main
Build step added for Build RetailSDK: Project : $/Dynamics 365/Trunk/RetailSdk-Main/dirs.proj
MSBuild Version = Latest (I took the default value)
MSBuild Architecture: MSBuild x86 (I took the default value)
Configuration: $(BuildConfiguration)
Clean checkbox: was changed to checked
Powershell step added for Copy Retail binaries:
Script Path: $/Dynamics 365/Trunk/RetailSdk-Main/BuildTools/Copy-RetailBinaries.ps1
Arguments: -BuildMetadataPath "$(Build.SourcesDirectory)\Metadata"
Control options: Enabled is checked
I did not change the Set Model versions step. It is the same as what is for box (1).
Script path: $(DynamicsSDK)\UpdateModelBuildNumbers.ps1
Arguments: -BuildMetadataPath "$(Build.SourcesDirectory)\Metadata" -BuildNumber "$(Build.BuildNumber)" -ModelExclusions "$(ModelVersionExclusions)"
Then I added after the Generate Packages step a Powershell step for Copy Retail Packages:
Script path: $/Dynamics 365/Trunk/RetailSdk-Main/BuildTools/Copy-RetailPackages.ps1
Argument: -BuildPackagePath "$(Agent.BuildDirectory)\Packages" -BuildVersion "$(Build.BuildNumber)"

As you can see below it completes successfully the 2 new Retail steps but fails on the Set Model Versions:

Any idea why it fails on Set Model Versions for box(2) ? Both points to the same Azure DevOps where the models and descriptor files are checked in.