From b6b4a67251b59543bdab91344edcc9e06f81f47d Mon Sep 17 00:00:00 2001 From: Freddy Kristiansen Date: Thu, 7 Dec 2023 10:47:15 +0100 Subject: [PATCH] check for packaging dll (#3266) Apparently the packaging DLL is not availbale in version 15 and earlier. Co-authored-by: freddydk --- AppHandling/Compile-AppInNavContainer.ps1 | 4 +++- HelperFunctions.ps1 | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/AppHandling/Compile-AppInNavContainer.ps1 b/AppHandling/Compile-AppInNavContainer.ps1 index 1fb58e86a..b9f15dd56 100644 --- a/AppHandling/Compile-AppInNavContainer.ps1 +++ b/AppHandling/Compile-AppInNavContainer.ps1 @@ -518,7 +518,9 @@ try { else { Add-Type -Path (Join-Path $alcPath Newtonsoft.Json.dll) Add-Type -Path (Join-Path $alcPath System.Collections.Immutable.dll) - Add-Type -Path (Join-Path $alcPath System.IO.Packaging.dll) + if (Test-Path (Join-Path $alcPath System.IO.Packaging.dll)) { + Add-Type -Path (Join-Path $alcPath System.IO.Packaging.dll) + } Add-Type -Path (Join-Path $alcPath Microsoft.Dynamics.Nav.CodeAnalysis.dll) $packageStream = [System.IO.File]::OpenRead($symbolsFile) diff --git a/HelperFunctions.ps1 b/HelperFunctions.ps1 index dc515c264..85880c625 100644 --- a/HelperFunctions.ps1 +++ b/HelperFunctions.ps1 @@ -1164,7 +1164,9 @@ function GetAppInfo { Add-Type -AssemblyName System.Text.Encoding LoadDLL -Path (Join-Path $alcDllPath Newtonsoft.Json.dll) LoadDLL -Path (Join-Path $alcDllPath System.Collections.Immutable.dll) - LoadDLL -Path (Join-Path $alcDllPath System.IO.Packaging.dll) + if (Test-Path (Join-Path $alcDllPath System.IO.Packaging.dll)) { + LoadDLL -Path (Join-Path $alcDllPath System.IO.Packaging.dll) + } LoadDLL -Path (Join-Path $alcDllPath Microsoft.Dynamics.Nav.CodeAnalysis.dll) $assembliesAdded = $true }