From 03546c2d1c120b5f5c7f38ef4dba0c39899a921b Mon Sep 17 00:00:00 2001 From: rsteber Date: Mon, 8 Apr 2024 17:50:44 +0200 Subject: [PATCH] Disk provider binary-only module reference fix If a module that is read by the disk metadata provider references a binary-only module, the "ListModulesInDependencyOrder()" method causes an exception error that is intercepted by the Get-D365Module function in line 172. As a result, the order of the modules cannot be determined taking the dependencies into account and "ListModules" is used instead. The problem can be easily avoided by adding the model manifest of the runtime metadata provider to the "CreateDiskProvider" method in line 165. This ensures that the disk provider has all the information it needs to determine the sequence for all modules based on the dependencies. --- d365fo.tools/functions/get-d365module.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d365fo.tools/functions/get-d365module.ps1 b/d365fo.tools/functions/get-d365module.ps1 index ae02a804..4dc7bded 100644 --- a/d365fo.tools/functions/get-d365module.ps1 +++ b/d365fo.tools/functions/get-d365module.ps1 @@ -162,7 +162,7 @@ function Get-D365Module { $diskProviderConfiguration = New-Object Microsoft.Dynamics.AX.Metadata.Storage.DiskProvider.DiskProviderConfiguration $diskProviderConfiguration.AddMetadataPath($PackageDirectory) $metadataProviderFactoryViaDisk = New-Object Microsoft.Dynamics.AX.Metadata.Storage.MetadataProviderFactory - $metadataProviderViaDisk = $metadataProviderFactoryViaDisk.CreateDiskProvider($diskProviderConfiguration) + $metadataProviderViaDisk = $metadataProviderFactoryViaDisk.CreateDiskProvider($diskProviderConfiguration, $metadataProviderViaRuntime.ModelManifest) Write-PSFMessage -Level Verbose -Message "MetadataProvider initialized." -Target $metadataProviderViaDisk