From 17489fd4d05cc903583721eadf46c8a3b39b02ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Samler?= Date: Thu, 7 May 2026 18:08:57 +0200 Subject: [PATCH 1/2] refactor: use TALXIS.Platform.Metadata.Packaging library for solution pack/unpack Replace the inline SolutionPackagerLib workaround with a reference to the new TALXIS.Platform.Metadata.Packaging NuGet package. Changes: - Remove ISolutionPackagerService from TALXIS.CLI.Core (now in library) - Remove SolutionPackagerServiceImpl from Dataverse.Application - Remove Microsoft.PowerApps.CLI.Core.linux-x64 workaround from csproj - Add TALXIS.Platform.Metadata.Packaging PackageReference - Update DI registration and using statements Depends on: TALXIS/platform-metadata#48 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Dataverse/ISolutionPackagerService.cs | 11 ----- .../Solution/SolutionImportCliCommand.cs | 1 + .../Solution/SolutionPackCliCommand.cs | 2 +- .../Solution/SolutionUnpackCliCommand.cs | 2 +- .../TALXIS.CLI.Features.Environment.csproj | 1 + ...eApplicationServiceCollectionExtensions.cs | 3 +- .../Sdk/SolutionPackagerService.cs | 49 ------------------- .../DataverseSolutionExportService.cs | 2 +- ....CLI.Platform.Dataverse.Application.csproj | 10 +--- 9 files changed, 8 insertions(+), 73 deletions(-) delete mode 100644 src/TALXIS.CLI.Core/Contracts/Dataverse/ISolutionPackagerService.cs delete mode 100644 src/TALXIS.CLI.Platform.Dataverse.Application/Sdk/SolutionPackagerService.cs diff --git a/src/TALXIS.CLI.Core/Contracts/Dataverse/ISolutionPackagerService.cs b/src/TALXIS.CLI.Core/Contracts/Dataverse/ISolutionPackagerService.cs deleted file mode 100644 index 61e03d1..0000000 --- a/src/TALXIS.CLI.Core/Contracts/Dataverse/ISolutionPackagerService.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace TALXIS.CLI.Core.Contracts.Dataverse; - -/// -/// Packs and unpacks Dataverse solution ZIPs using SolutionPackager. -/// No Dataverse connection required — operates on local files only. -/// -public interface ISolutionPackagerService -{ - void Pack(string folder, string zipPath, bool managed); - void Unpack(string zipPath, string outputFolder, bool managed); -} diff --git a/src/TALXIS.CLI.Features.Environment/Solution/SolutionImportCliCommand.cs b/src/TALXIS.CLI.Features.Environment/Solution/SolutionImportCliCommand.cs index e35d334..105bb2c 100644 --- a/src/TALXIS.CLI.Features.Environment/Solution/SolutionImportCliCommand.cs +++ b/src/TALXIS.CLI.Features.Environment/Solution/SolutionImportCliCommand.cs @@ -5,6 +5,7 @@ using TALXIS.CLI.Core.Contracts.Dataverse; using TALXIS.CLI.Core.DependencyInjection; using TALXIS.CLI.Logging; +using TALXIS.Platform.Metadata.Packaging; namespace TALXIS.CLI.Features.Environment.Solution; diff --git a/src/TALXIS.CLI.Features.Environment/Solution/SolutionPackCliCommand.cs b/src/TALXIS.CLI.Features.Environment/Solution/SolutionPackCliCommand.cs index 1614dcf..7e49f12 100644 --- a/src/TALXIS.CLI.Features.Environment/Solution/SolutionPackCliCommand.cs +++ b/src/TALXIS.CLI.Features.Environment/Solution/SolutionPackCliCommand.cs @@ -1,9 +1,9 @@ using DotMake.CommandLine; using Microsoft.Extensions.Logging; using TALXIS.CLI.Core; -using TALXIS.CLI.Core.Contracts.Dataverse; using TALXIS.CLI.Core.DependencyInjection; using TALXIS.CLI.Logging; +using TALXIS.Platform.Metadata.Packaging; namespace TALXIS.CLI.Features.Environment.Solution; diff --git a/src/TALXIS.CLI.Features.Environment/Solution/SolutionUnpackCliCommand.cs b/src/TALXIS.CLI.Features.Environment/Solution/SolutionUnpackCliCommand.cs index 603a3ff..42eac26 100644 --- a/src/TALXIS.CLI.Features.Environment/Solution/SolutionUnpackCliCommand.cs +++ b/src/TALXIS.CLI.Features.Environment/Solution/SolutionUnpackCliCommand.cs @@ -1,9 +1,9 @@ using DotMake.CommandLine; using Microsoft.Extensions.Logging; using TALXIS.CLI.Core; -using TALXIS.CLI.Core.Contracts.Dataverse; using TALXIS.CLI.Core.DependencyInjection; using TALXIS.CLI.Logging; +using TALXIS.Platform.Metadata.Packaging; namespace TALXIS.CLI.Features.Environment.Solution; diff --git a/src/TALXIS.CLI.Features.Environment/TALXIS.CLI.Features.Environment.csproj b/src/TALXIS.CLI.Features.Environment/TALXIS.CLI.Features.Environment.csproj index 17073cb..88b700c 100644 --- a/src/TALXIS.CLI.Features.Environment/TALXIS.CLI.Features.Environment.csproj +++ b/src/TALXIS.CLI.Features.Environment/TALXIS.CLI.Features.Environment.csproj @@ -8,6 +8,7 @@ + diff --git a/src/TALXIS.CLI.Platform.Dataverse.Application/DependencyInjection/DataverseApplicationServiceCollectionExtensions.cs b/src/TALXIS.CLI.Platform.Dataverse.Application/DependencyInjection/DataverseApplicationServiceCollectionExtensions.cs index 5731793..ed0a3ce 100644 --- a/src/TALXIS.CLI.Platform.Dataverse.Application/DependencyInjection/DataverseApplicationServiceCollectionExtensions.cs +++ b/src/TALXIS.CLI.Platform.Dataverse.Application/DependencyInjection/DataverseApplicationServiceCollectionExtensions.cs @@ -1,6 +1,7 @@ using Microsoft.Extensions.DependencyInjection; using TALXIS.CLI.Core.Contracts.Dataverse; using TALXIS.CLI.Platform.Dataverse.Application.Services; +using TALXIS.Platform.Metadata.Packaging; namespace TALXIS.CLI.Platform.Dataverse.Application.DependencyInjection; @@ -34,7 +35,7 @@ public static IServiceCollection AddTxcDataverseApplication(this IServiceCollect services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); - services.AddSingleton(); + services.AddSingleton(); services.AddSingleton(); return services; } diff --git a/src/TALXIS.CLI.Platform.Dataverse.Application/Sdk/SolutionPackagerService.cs b/src/TALXIS.CLI.Platform.Dataverse.Application/Sdk/SolutionPackagerService.cs deleted file mode 100644 index 601557c..0000000 --- a/src/TALXIS.CLI.Platform.Dataverse.Application/Sdk/SolutionPackagerService.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Diagnostics; -using Microsoft.Crm.Tools.SolutionPackager; -using TALXIS.CLI.Core.Contracts.Dataverse; - -namespace TALXIS.CLI.Platform.Dataverse.Application.Sdk; - -/// -/// Wraps SolutionPackagerLib for packing and unpacking Dataverse solution ZIPs. -/// -internal sealed class SolutionPackagerServiceImpl : ISolutionPackagerService -{ - /// - /// Unpacks a solution ZIP file into a folder structure. - /// - public void Unpack(string zipPath, string outputFolder, bool managed) - { - var arguments = new PackagerArguments - { - Action = CommandAction.Extract, - PathToZipFile = zipPath, - Folder = outputFolder, - PackageType = managed ? SolutionPackageType.Managed : SolutionPackageType.Unmanaged, - AllowDeletes = AllowDelete.Yes, - AllowWrites = AllowWrite.Yes, - ErrorLevel = TraceLevel.Info, - }; - - var packager = new SolutionPackager(arguments); - packager.Run(); - } - - /// - /// Packs a folder structure into a solution ZIP file. - /// - public void Pack(string folder, string zipPath, bool managed) - { - var arguments = new PackagerArguments - { - Action = CommandAction.Pack, - PathToZipFile = zipPath, - Folder = folder, - PackageType = managed ? SolutionPackageType.Managed : SolutionPackageType.Unmanaged, - ErrorLevel = TraceLevel.Info, - }; - - var packager = new SolutionPackager(arguments); - packager.Run(); - } -} diff --git a/src/TALXIS.CLI.Platform.Dataverse.Application/Services/DataverseSolutionExportService.cs b/src/TALXIS.CLI.Platform.Dataverse.Application/Services/DataverseSolutionExportService.cs index d4c966f..26a3542 100644 --- a/src/TALXIS.CLI.Platform.Dataverse.Application/Services/DataverseSolutionExportService.cs +++ b/src/TALXIS.CLI.Platform.Dataverse.Application/Services/DataverseSolutionExportService.cs @@ -1,6 +1,6 @@ using TALXIS.CLI.Core.Contracts.Dataverse; -using TALXIS.CLI.Platform.Dataverse.Application.Sdk; using TALXIS.CLI.Platform.Dataverse.Runtime; +using TALXIS.Platform.Metadata.Packaging; namespace TALXIS.CLI.Platform.Dataverse.Application.Services; diff --git a/src/TALXIS.CLI.Platform.Dataverse.Application/TALXIS.CLI.Platform.Dataverse.Application.csproj b/src/TALXIS.CLI.Platform.Dataverse.Application/TALXIS.CLI.Platform.Dataverse.Application.csproj index cc49bfe..13c049b 100644 --- a/src/TALXIS.CLI.Platform.Dataverse.Application/TALXIS.CLI.Platform.Dataverse.Application.csproj +++ b/src/TALXIS.CLI.Platform.Dataverse.Application/TALXIS.CLI.Platform.Dataverse.Application.csproj @@ -9,15 +9,7 @@ - - - - - - - $(PkgMicrosoft_PowerApps_CLI_Core_linux-x64)\tools\SolutionPackagerLib.dll - true - + From 455e68430eff2021755111e3f54cdc63ca7b542c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Samler?= Date: Thu, 7 May 2026 18:44:22 +0200 Subject: [PATCH 2/2] fix: correct package version to 0.4.0 and restore SolutionExporter using MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Changed TALXIS.Platform.Metadata.Packaging version from 1.0.0 to 0.4.0 to match other TALXIS.Platform.Metadata packages - Restored 'using TALXIS.CLI.Platform.Dataverse.Application.Sdk' in DataverseSolutionExportService.cs — SolutionExporter still lives there Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../TALXIS.CLI.Features.Environment.csproj | 2 +- .../Services/DataverseSolutionExportService.cs | 1 + .../TALXIS.CLI.Platform.Dataverse.Application.csproj | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/TALXIS.CLI.Features.Environment/TALXIS.CLI.Features.Environment.csproj b/src/TALXIS.CLI.Features.Environment/TALXIS.CLI.Features.Environment.csproj index 88b700c..c7df960 100644 --- a/src/TALXIS.CLI.Features.Environment/TALXIS.CLI.Features.Environment.csproj +++ b/src/TALXIS.CLI.Features.Environment/TALXIS.CLI.Features.Environment.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/TALXIS.CLI.Platform.Dataverse.Application/Services/DataverseSolutionExportService.cs b/src/TALXIS.CLI.Platform.Dataverse.Application/Services/DataverseSolutionExportService.cs index 26a3542..119c80b 100644 --- a/src/TALXIS.CLI.Platform.Dataverse.Application/Services/DataverseSolutionExportService.cs +++ b/src/TALXIS.CLI.Platform.Dataverse.Application/Services/DataverseSolutionExportService.cs @@ -1,4 +1,5 @@ using TALXIS.CLI.Core.Contracts.Dataverse; +using TALXIS.CLI.Platform.Dataverse.Application.Sdk; using TALXIS.CLI.Platform.Dataverse.Runtime; using TALXIS.Platform.Metadata.Packaging; diff --git a/src/TALXIS.CLI.Platform.Dataverse.Application/TALXIS.CLI.Platform.Dataverse.Application.csproj b/src/TALXIS.CLI.Platform.Dataverse.Application/TALXIS.CLI.Platform.Dataverse.Application.csproj index 13c049b..ebaaf1e 100644 --- a/src/TALXIS.CLI.Platform.Dataverse.Application/TALXIS.CLI.Platform.Dataverse.Application.csproj +++ b/src/TALXIS.CLI.Platform.Dataverse.Application/TALXIS.CLI.Platform.Dataverse.Application.csproj @@ -9,7 +9,7 @@ - +