From cd272493f378e49446bdef02e934bfff9fc8884c Mon Sep 17 00:00:00 2001 From: Alexander Zekelin Date: Sun, 26 Apr 2026 13:26:13 +0200 Subject: [PATCH 1/7] code app added to slnx --- TALXIS.DevKit.Build.slnx | 1 + 1 file changed, 1 insertion(+) diff --git a/TALXIS.DevKit.Build.slnx b/TALXIS.DevKit.Build.slnx index 8d1e2e8..70e35d5 100644 --- a/TALXIS.DevKit.Build.slnx +++ b/TALXIS.DevKit.Build.slnx @@ -6,6 +6,7 @@ + From dce9802f7def74da423b5d62b053ec1eabe0dcaa Mon Sep 17 00:00:00 2001 From: Alexander Zekelin Date: Tue, 12 May 2026 22:19:32 +0200 Subject: [PATCH 2/7] Enable plugin/workflow-activity dependency merging --- src/Dataverse/Plugin/README.md | 6 +- ...ALXIS.DevKit.Build.Dataverse.Plugin.nuspec | 1 + ...TALXIS.DevKit.Build.Dataverse.Plugin.props | 1 + .../msbuild/tasks/StubForILRepack.targets | 10 +++ .../Targets/MergePluginDependencies.targets | 87 +++++++++++++++++++ src/Dataverse/WorkflowActivity/README.md | 6 +- ...it.Build.Dataverse.WorkflowActivity.nuspec | 1 + ...Kit.Build.Dataverse.WorkflowActivity.props | 1 + 8 files changed, 109 insertions(+), 4 deletions(-) create mode 100644 src/Dataverse/Tasks/msbuild/tasks/StubForILRepack.targets create mode 100644 src/Dataverse/Tasks/msbuild/tasks/Targets/MergePluginDependencies.targets diff --git a/src/Dataverse/Plugin/README.md b/src/Dataverse/Plugin/README.md index d153e96..6c656c6 100644 --- a/src/Dataverse/Plugin/README.md +++ b/src/Dataverse/Plugin/README.md @@ -1,6 +1,6 @@ # TALXIS.DevKit.Build.Dataverse.Plugin -MSBuild integration for Dataverse plugin assembly projects. Configures Visual Studio project type GUIDs for CRM plugin development, brings in `Microsoft.CrmSdk.CoreAssemblies` and `Microsoft.PowerApps.MSBuild.Plugin`, applies automatic Git-based versioning, and exposes metadata targets that allow Solution projects to discover and integrate plugin assemblies during build. +MSBuild integration for Dataverse plugin assembly projects. Configures Visual Studio project type GUIDs for CRM plugin development, brings in `Microsoft.CrmSdk.CoreAssemblies` and `Microsoft.PowerApps.MSBuild.Plugin`, applies automatic Git-based versioning, merges referenced managed dependencies into the output DLL via ILRepack so the Dataverse sandbox can load all required types from a single assembly, and exposes metadata targets that allow Solution projects to discover and integrate plugin assemblies during build. ## Installation @@ -25,6 +25,7 @@ The package sets `ProjectType` to `Plugin` and configures `ProjectTypeGuids` for ### Build-time targets - **TalxisBeforeBuild** (runs before `BeforeBuild`) -- executes `GenerateVersionNumber` followed by `ApplyPluginVersionNumber` to set `AssemblyVersion`, `FileVersion`, `Version`, and `PackageVersion` from Git. +- **TalxisMergePluginDependencies** (runs after `Build`) -- uses [ILRepack](https://github.com/gluck/il-repack) to merge every managed DLL that landed in `$(OutDir)` into the main plugin assembly, so the Dataverse sandbox (which loads a single assembly) can resolve all referenced types without sibling DLLs. Sandbox-provided assemblies are skipped: `Microsoft.Xrm.Sdk*`, `Microsoft.Crm.Sdk.Proxy`, `Newtonsoft.Json`, `System.*`, `mscorlib`, `netstandard`. Idempotent — always reads the raw compiler output from `$(IntermediateOutputPath)` so the target can safely re-run within the same Solution build. Merged types keep their original public names (`Internalize=false`) to preserve Dataverse's reflection-based plugin type detection. Disable per-project with `false`. ### Integration targets @@ -44,10 +45,11 @@ These targets are called by `TALXIS.DevKit.Build.Dataverse.Solution` when it dis | `PluginTargetFramework` | `$(TargetFramework)` or `net462` | Target framework used to locate the compiled plugin DLL. | | `PluginPublishFolderName` | `publish` | Publish folder name under `bin\\\`. | | `PluginAssemblyId` | _(auto-generated)_ | Explicit GUID for the plugin assembly metadata; a new GUID is generated if empty. | +| `TalxisMergePluginDependencies` | `true` | When `true`, runs `TalxisMergePluginDependencies` after `Build` to ILRepack referenced DLLs into the plugin assembly. Set to `false` to opt out. | ## Related Packages -- **Depends on**: `TALXIS.DevKit.Build.Dataverse.Tasks`, `Microsoft.PowerApps.MSBuild.Plugin`, `Microsoft.CrmSdk.CoreAssemblies` +- **Depends on**: `TALXIS.DevKit.Build.Dataverse.Tasks`, `Microsoft.PowerApps.MSBuild.Plugin`, `Microsoft.CrmSdk.CoreAssemblies`, `ILRepack.Lib.MSBuild.Task` - **Consumed by**: `TALXIS.DevKit.Build.Dataverse.Solution` projects via `ProjectReference` diff --git a/src/Dataverse/Plugin/TALXIS.DevKit.Build.Dataverse.Plugin.nuspec b/src/Dataverse/Plugin/TALXIS.DevKit.Build.Dataverse.Plugin.nuspec index 6c2dda0..e3c5b03 100644 --- a/src/Dataverse/Plugin/TALXIS.DevKit.Build.Dataverse.Plugin.nuspec +++ b/src/Dataverse/Plugin/TALXIS.DevKit.Build.Dataverse.Plugin.nuspec @@ -18,6 +18,7 @@ + diff --git a/src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.props b/src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.props index 6f64f4c..97c7590 100644 --- a/src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.props +++ b/src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.props @@ -13,5 +13,6 @@ + diff --git a/src/Dataverse/Tasks/msbuild/tasks/StubForILRepack.targets b/src/Dataverse/Tasks/msbuild/tasks/StubForILRepack.targets new file mode 100644 index 0000000..c8a230c --- /dev/null +++ b/src/Dataverse/Tasks/msbuild/tasks/StubForILRepack.targets @@ -0,0 +1,10 @@ + + + + diff --git a/src/Dataverse/Tasks/msbuild/tasks/Targets/MergePluginDependencies.targets b/src/Dataverse/Tasks/msbuild/tasks/Targets/MergePluginDependencies.targets new file mode 100644 index 0000000..e521a9a --- /dev/null +++ b/src/Dataverse/Tasks/msbuild/tasks/Targets/MergePluginDependencies.targets @@ -0,0 +1,87 @@ + + + + + + + + true + + $(MSBuildThisFileDirectory)..\StubForILRepack.targets + + + + + <_TalxisMergePrimaryRaw>$(IntermediateOutputPath)$(AssemblyName).dll + <_TalxisMergeOutputDll>$(OutDir)$(AssemblyName).dll + + + <_TalxisMergeAll Include="$(OutDir)*.dll" /> + <_TalxisMergePrimary Include="@(_TalxisMergeAll)" + Condition=" '%(Filename)%(Extension)' == '$(AssemblyName).dll' " /> + <_TalxisMergeDeps Include="@(_TalxisMergeAll)" Exclude="@(_TalxisMergePrimary)" /> + + <_TalxisMergeDeps Remove="@(_TalxisMergeDeps)" + Condition=" '%(Filename)' == 'mscorlib' + Or '%(Filename)' == 'netstandard' + Or '%(Filename)' == 'Newtonsoft.Json' + Or '%(Filename)' == 'Microsoft.Xrm.Sdk' + Or '%(Filename)' == 'Microsoft.Xrm.Sdk.Deployment' + Or '%(Filename)' == 'Microsoft.Xrm.Sdk.Workflow' + Or '%(Filename)' == 'Microsoft.Crm.Sdk.Proxy' + Or $([System.String]::Copy('%(Filename)').StartsWith('System.')) " /> + + + + + + + + + + diff --git a/src/Dataverse/WorkflowActivity/README.md b/src/Dataverse/WorkflowActivity/README.md index d364cbf..f5ba3e1 100644 --- a/src/Dataverse/WorkflowActivity/README.md +++ b/src/Dataverse/WorkflowActivity/README.md @@ -1,6 +1,6 @@ # TALXIS.DevKit.Build.Dataverse.WorkflowActivity -MSBuild integration for Dynamics 365 custom workflow activity assembly projects. Mirrors the Plugin package pattern: configures Visual Studio project type GUIDs, applies automatic Git-based versioning, and exposes metadata targets that allow Solution projects to discover and integrate workflow activity assemblies during build. +MSBuild integration for Dynamics 365 custom workflow activity assembly projects. Mirrors the Plugin package pattern: configures Visual Studio project type GUIDs, applies automatic Git-based versioning, merges referenced managed dependencies into the output DLL via ILRepack so the Dataverse sandbox can load all required types from a single assembly, and exposes metadata targets that allow Solution projects to discover and integrate workflow activity assemblies during build. ## Installation @@ -25,6 +25,7 @@ The package sets `ProjectType` to `WorkflowActivity` and configures `ProjectType ### Build-time targets - **TalxisBeforeBuild** (runs before `BeforeBuild`) -- executes `GenerateVersionNumber` followed by `ApplyPluginVersionNumber` to set `AssemblyVersion`, `FileVersion`, `Version`, and `PackageVersion` from Git. +- **TalxisMergePluginDependencies** (runs after `Build`) -- uses [ILRepack](https://github.com/gluck/il-repack) to merge every managed DLL that landed in `$(OutDir)` into the main workflow activity assembly, so the Dataverse sandbox (which loads a single assembly) can resolve all referenced types without sibling DLLs. Sandbox-provided assemblies are skipped: `Microsoft.Xrm.Sdk*`, `Microsoft.Crm.Sdk.Proxy`, `Newtonsoft.Json`, `System.*`, `mscorlib`, `netstandard`. Idempotent — always reads the raw compiler output from `$(IntermediateOutputPath)` so the target can safely re-run within the same Solution build. Merged types keep their original public names (`Internalize=false`) to preserve Dataverse's reflection-based detection of `CodeActivity` subclasses. Disable per-project with `false`. ### Integration targets @@ -44,10 +45,11 @@ These targets are called by `TALXIS.DevKit.Build.Dataverse.Solution` when it dis | `WorkflowActivityTargetFramework` | `$(TargetFramework)` or `net462` | Target framework used to locate the compiled workflow activity DLL. | | `WorkflowActivityPublishFolderName` | `publish` | Publish folder name under `bin\\\`. | | `WorkflowActivityAssemblyId` | _(auto-generated)_ | Explicit GUID for the workflow activity assembly metadata; a new GUID is generated if empty. | +| `TalxisMergePluginDependencies` | `true` | When `true`, runs `TalxisMergePluginDependencies` after `Build` to ILRepack referenced DLLs into the workflow activity assembly. Set to `false` to opt out. | ## Related Packages -- **Depends on**: `TALXIS.DevKit.Build.Dataverse.Tasks`, `Microsoft.PowerApps.MSBuild.Plugin`, `Microsoft.CrmSdk.CoreAssemblies` +- **Depends on**: `TALXIS.DevKit.Build.Dataverse.Tasks`, `Microsoft.PowerApps.MSBuild.Plugin`, `Microsoft.CrmSdk.CoreAssemblies`, `ILRepack.Lib.MSBuild.Task` - **Consumed by**: `TALXIS.DevKit.Build.Dataverse.Solution` projects via `ProjectReference` diff --git a/src/Dataverse/WorkflowActivity/TALXIS.DevKit.Build.Dataverse.WorkflowActivity.nuspec b/src/Dataverse/WorkflowActivity/TALXIS.DevKit.Build.Dataverse.WorkflowActivity.nuspec index bf94329..ecbb4e5 100644 --- a/src/Dataverse/WorkflowActivity/TALXIS.DevKit.Build.Dataverse.WorkflowActivity.nuspec +++ b/src/Dataverse/WorkflowActivity/TALXIS.DevKit.Build.Dataverse.WorkflowActivity.nuspec @@ -18,6 +18,7 @@ + diff --git a/src/Dataverse/WorkflowActivity/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.WorkflowActivity.props b/src/Dataverse/WorkflowActivity/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.WorkflowActivity.props index 7cce676..b1e0c4d 100644 --- a/src/Dataverse/WorkflowActivity/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.WorkflowActivity.props +++ b/src/Dataverse/WorkflowActivity/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.WorkflowActivity.props @@ -10,5 +10,6 @@ + From 6d05d97303c1d5002fc39d366e2fec0afaab31a2 Mon Sep 17 00:00:00 2001 From: Alexander Zekelin Date: Mon, 18 May 2026 15:27:24 +0200 Subject: [PATCH 3/7] fix: skip every Microsoft.Xrm.Sdk.* sub-namespace, not just two The exclusion list claimed to skip Microsoft.Xrm.Sdk* (per README and header comment) but only filtered three exact filenames in practice: Microsoft.Xrm.Sdk, .Deployment, .Workflow. Any future or third-party Microsoft.Xrm.Sdk..dll that ended up in OutDir would be merged into the plugin assembly and cause runtime version clashes inside the Dataverse sandbox. Replace the two specific Deployment/Workflow entries with a StartsWith('Microsoft.Xrm.Sdk.') prefix check covering all sub- namespaces. Exact 'Microsoft.Xrm.Sdk' (no trailing dot) stays as its own entry so the base assembly is still excluded. --- .../msbuild/tasks/Targets/MergePluginDependencies.targets | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Dataverse/Tasks/msbuild/tasks/Targets/MergePluginDependencies.targets b/src/Dataverse/Tasks/msbuild/tasks/Targets/MergePluginDependencies.targets index e521a9a..bc2b74b 100644 --- a/src/Dataverse/Tasks/msbuild/tasks/Targets/MergePluginDependencies.targets +++ b/src/Dataverse/Tasks/msbuild/tasks/Targets/MergePluginDependencies.targets @@ -57,8 +57,7 @@ Or '%(Filename)' == 'netstandard' Or '%(Filename)' == 'Newtonsoft.Json' Or '%(Filename)' == 'Microsoft.Xrm.Sdk' - Or '%(Filename)' == 'Microsoft.Xrm.Sdk.Deployment' - Or '%(Filename)' == 'Microsoft.Xrm.Sdk.Workflow' + Or $([System.String]::Copy('%(Filename)').StartsWith('Microsoft.Xrm.Sdk.')) Or '%(Filename)' == 'Microsoft.Crm.Sdk.Proxy' Or $([System.String]::Copy('%(Filename)').StartsWith('System.')) " /> From 34ea5d29d5fe894fb00d310e9b30987fc3f5414d Mon Sep 17 00:00:00 2001 From: Alexander Zekelin Date: Wed, 20 May 2026 17:08:52 +0200 Subject: [PATCH 4/7] refactor: move ILRepack auto-wiring from Tasks to Plugin/WorkflowActivity --- ...TALXIS.DevKit.Build.Dataverse.Plugin.props | 2 +- ...LXIS.DevKit.Build.Dataverse.Plugin.targets | 12 ++++ .../msbuild/tasks/StubForILRepack.targets | 7 --- .../Targets/MergePluginDependencies.targets | 55 ++++--------------- ...Kit.Build.Dataverse.WorkflowActivity.props | 2 +- ...t.Build.Dataverse.WorkflowActivity.targets | 10 ++++ 6 files changed, 36 insertions(+), 52 deletions(-) diff --git a/src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.props b/src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.props index 97c7590..aa8390b 100644 --- a/src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.props +++ b/src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.props @@ -13,6 +13,6 @@ - + diff --git a/src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.targets b/src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.targets index c02b256..66f6926 100644 --- a/src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.targets +++ b/src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.targets @@ -25,6 +25,18 @@ + + + true + $(TalxisILRepackStub) + + + + diff --git a/src/Dataverse/Tasks/msbuild/tasks/StubForILRepack.targets b/src/Dataverse/Tasks/msbuild/tasks/StubForILRepack.targets index c8a230c..4617c3b 100644 --- a/src/Dataverse/Tasks/msbuild/tasks/StubForILRepack.targets +++ b/src/Dataverse/Tasks/msbuild/tasks/StubForILRepack.targets @@ -1,10 +1,3 @@ - diff --git a/src/Dataverse/Tasks/msbuild/tasks/Targets/MergePluginDependencies.targets b/src/Dataverse/Tasks/msbuild/tasks/Targets/MergePluginDependencies.targets index bc2b74b..2879162 100644 --- a/src/Dataverse/Tasks/msbuild/tasks/Targets/MergePluginDependencies.targets +++ b/src/Dataverse/Tasks/msbuild/tasks/Targets/MergePluginDependencies.targets @@ -2,45 +2,18 @@ - - + - true - - $(MSBuildThisFileDirectory)..\StubForILRepack.targets + $(MSBuildThisFileDirectory)..\StubForILRepack.targets - + + <_TalxisMergePrimaryRaw>$(IntermediateOutputPath)$(AssemblyName).dll <_TalxisMergeOutputDll>$(OutDir)$(AssemblyName).dll @@ -50,8 +23,7 @@ <_TalxisMergePrimary Include="@(_TalxisMergeAll)" Condition=" '%(Filename)%(Extension)' == '$(AssemblyName).dll' " /> <_TalxisMergeDeps Include="@(_TalxisMergeAll)" Exclude="@(_TalxisMergePrimary)" /> - + <_TalxisMergeDeps Remove="@(_TalxisMergeDeps)" Condition=" '%(Filename)' == 'mscorlib' Or '%(Filename)' == 'netstandard' @@ -69,11 +41,8 @@ Text="TalxisMergePluginDependencies: nothing to merge" Condition=" '@(_TalxisMergeDeps)' == '' " /> - + - + diff --git a/src/Dataverse/WorkflowActivity/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.WorkflowActivity.targets b/src/Dataverse/WorkflowActivity/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.WorkflowActivity.targets index 54aa101..1defc12 100644 --- a/src/Dataverse/WorkflowActivity/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.WorkflowActivity.targets +++ b/src/Dataverse/WorkflowActivity/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.WorkflowActivity.targets @@ -17,6 +17,16 @@ + + true + $(TalxisILRepackStub) + + + + From e5f5ac315617baa5b54239ca8280eaafdaf37339 Mon Sep 17 00:00:00 2001 From: Alexander Zekelin Date: Wed, 20 May 2026 21:39:43 +0200 Subject: [PATCH 5/7] fix: per-package ILRepack stub, absolute LibraryPath --- src/Dataverse/Plugin/msbuild/tasks/StubForILRepack.targets | 5 +++++ .../tasks/TALXIS.DevKit.Build.Dataverse.Plugin.targets | 5 ++++- .../msbuild/tasks/Targets/MergePluginDependencies.targets | 4 +++- .../WorkflowActivity/msbuild/tasks/StubForILRepack.targets | 5 +++++ .../TALXIS.DevKit.Build.Dataverse.WorkflowActivity.targets | 5 ++++- 5 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 src/Dataverse/Plugin/msbuild/tasks/StubForILRepack.targets create mode 100644 src/Dataverse/WorkflowActivity/msbuild/tasks/StubForILRepack.targets diff --git a/src/Dataverse/Plugin/msbuild/tasks/StubForILRepack.targets b/src/Dataverse/Plugin/msbuild/tasks/StubForILRepack.targets new file mode 100644 index 0000000..dcf8208 --- /dev/null +++ b/src/Dataverse/Plugin/msbuild/tasks/StubForILRepack.targets @@ -0,0 +1,5 @@ + + + + diff --git a/src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.targets b/src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.targets index 66f6926..1895011 100644 --- a/src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.targets +++ b/src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.targets @@ -29,7 +29,10 @@ Opt out: false. --> true - $(TalxisILRepackStub) + + $(MSBuildThisFileDirectory)StubForILRepack.targets + + LibraryPath="$([System.IO.Path]::GetFullPath('$(OutDir)'))" /> diff --git a/src/Dataverse/WorkflowActivity/msbuild/tasks/StubForILRepack.targets b/src/Dataverse/WorkflowActivity/msbuild/tasks/StubForILRepack.targets new file mode 100644 index 0000000..85b201a --- /dev/null +++ b/src/Dataverse/WorkflowActivity/msbuild/tasks/StubForILRepack.targets @@ -0,0 +1,5 @@ + + + + diff --git a/src/Dataverse/WorkflowActivity/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.WorkflowActivity.targets b/src/Dataverse/WorkflowActivity/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.WorkflowActivity.targets index 1defc12..a5a6625 100644 --- a/src/Dataverse/WorkflowActivity/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.WorkflowActivity.targets +++ b/src/Dataverse/WorkflowActivity/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.WorkflowActivity.targets @@ -19,7 +19,10 @@ true - $(TalxisILRepackStub) + + $(MSBuildThisFileDirectory)StubForILRepack.targets Date: Fri, 12 Jun 2026 16:37:55 +0200 Subject: [PATCH 6/7] refactor: align ILRepack naming with repo conventions Align the public API surface of the dependency-merging feature with the established naming conventions in this repository: Targets: - Worker target (unprefixed, callable): MergeAssemblyDependencies - Hook targets (private, auto-wired): _TalxisPluginAutoMergeHook, _TalxisWorkflowActivityAutoMergeHook (unchanged) Properties: - Opt-out switch: TalxisSkipAssemblyMerge (TalxisSkip* family, opt-out polarity, matching TalxisSkipDuplicateGuidValidation etc.) Files: - MergePluginDependencies.targets -> MergeAssemblyDependencies.targets - StubForILRepack.targets -> DisableILRepackAutoMerge.targets - Remove dead Tasks/StubForILRepack.targets + $(TalxisILRepackStub) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/Dataverse/Plugin/README.md | 4 ++-- ...rgets => DisableILRepackAutoMerge.targets} | 0 ...LXIS.DevKit.Build.Dataverse.Plugin.targets | 11 +++++------ .../msbuild/tasks/StubForILRepack.targets | 3 --- ...gets => MergeAssemblyDependencies.targets} | 19 ++++++------------- src/Dataverse/WorkflowActivity/README.md | 4 ++-- ...rgets => DisableILRepackAutoMerge.targets} | 0 ...t.Build.Dataverse.WorkflowActivity.targets | 9 +++++---- 8 files changed, 20 insertions(+), 30 deletions(-) rename src/Dataverse/Plugin/msbuild/tasks/{StubForILRepack.targets => DisableILRepackAutoMerge.targets} (100%) delete mode 100644 src/Dataverse/Tasks/msbuild/tasks/StubForILRepack.targets rename src/Dataverse/Tasks/msbuild/tasks/Targets/{MergePluginDependencies.targets => MergeAssemblyDependencies.targets} (73%) rename src/Dataverse/WorkflowActivity/msbuild/tasks/{StubForILRepack.targets => DisableILRepackAutoMerge.targets} (100%) diff --git a/src/Dataverse/Plugin/README.md b/src/Dataverse/Plugin/README.md index 6c656c6..82f5ae6 100644 --- a/src/Dataverse/Plugin/README.md +++ b/src/Dataverse/Plugin/README.md @@ -25,7 +25,7 @@ The package sets `ProjectType` to `Plugin` and configures `ProjectTypeGuids` for ### Build-time targets - **TalxisBeforeBuild** (runs before `BeforeBuild`) -- executes `GenerateVersionNumber` followed by `ApplyPluginVersionNumber` to set `AssemblyVersion`, `FileVersion`, `Version`, and `PackageVersion` from Git. -- **TalxisMergePluginDependencies** (runs after `Build`) -- uses [ILRepack](https://github.com/gluck/il-repack) to merge every managed DLL that landed in `$(OutDir)` into the main plugin assembly, so the Dataverse sandbox (which loads a single assembly) can resolve all referenced types without sibling DLLs. Sandbox-provided assemblies are skipped: `Microsoft.Xrm.Sdk*`, `Microsoft.Crm.Sdk.Proxy`, `Newtonsoft.Json`, `System.*`, `mscorlib`, `netstandard`. Idempotent — always reads the raw compiler output from `$(IntermediateOutputPath)` so the target can safely re-run within the same Solution build. Merged types keep their original public names (`Internalize=false`) to preserve Dataverse's reflection-based plugin type detection. Disable per-project with `false`. +- **MergeAssemblyDependencies** (runs after `Build`) -- uses [ILRepack](https://github.com/gluck/il-repack) to merge every managed DLL that landed in `$(OutDir)` into the main plugin assembly, so the Dataverse sandbox (which loads a single assembly) can resolve all referenced types without sibling DLLs. Sandbox-provided assemblies are skipped: `Microsoft.Xrm.Sdk*`, `Microsoft.Crm.Sdk.Proxy`, `Newtonsoft.Json`, `System.*`, `mscorlib`, `netstandard`. Idempotent — always reads the raw compiler output from `$(IntermediateOutputPath)` so the target can safely re-run within the same Solution build. Merged types keep their original public names (`Internalize=false`) to preserve Dataverse's reflection-based plugin type detection. Disable per-project with `true`. ### Integration targets @@ -45,7 +45,7 @@ These targets are called by `TALXIS.DevKit.Build.Dataverse.Solution` when it dis | `PluginTargetFramework` | `$(TargetFramework)` or `net462` | Target framework used to locate the compiled plugin DLL. | | `PluginPublishFolderName` | `publish` | Publish folder name under `bin\\\`. | | `PluginAssemblyId` | _(auto-generated)_ | Explicit GUID for the plugin assembly metadata; a new GUID is generated if empty. | -| `TalxisMergePluginDependencies` | `true` | When `true`, runs `TalxisMergePluginDependencies` after `Build` to ILRepack referenced DLLs into the plugin assembly. Set to `false` to opt out. | +| `TalxisSkipAssemblyMerge` | _(unset)_ | When `true`, skips the post-build `MergeAssemblyDependencies` ILRepack step. | ## Related Packages diff --git a/src/Dataverse/Plugin/msbuild/tasks/StubForILRepack.targets b/src/Dataverse/Plugin/msbuild/tasks/DisableILRepackAutoMerge.targets similarity index 100% rename from src/Dataverse/Plugin/msbuild/tasks/StubForILRepack.targets rename to src/Dataverse/Plugin/msbuild/tasks/DisableILRepackAutoMerge.targets diff --git a/src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.targets b/src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.targets index 1895011..6687a6d 100644 --- a/src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.targets +++ b/src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.targets @@ -25,20 +25,19 @@ - + - true - $(MSBuildThisFileDirectory)StubForILRepack.targets + $(MSBuildThisFileDirectory)DisableILRepackAutoMerge.targets + Condition="'$(TalxisSkipAssemblyMerge)' != 'true'" + DependsOnTargets="MergeAssemblyDependencies" /> - - diff --git a/src/Dataverse/Tasks/msbuild/tasks/Targets/MergePluginDependencies.targets b/src/Dataverse/Tasks/msbuild/tasks/Targets/MergeAssemblyDependencies.targets similarity index 73% rename from src/Dataverse/Tasks/msbuild/tasks/Targets/MergePluginDependencies.targets rename to src/Dataverse/Tasks/msbuild/tasks/Targets/MergeAssemblyDependencies.targets index e138514..7a56b2b 100644 --- a/src/Dataverse/Tasks/msbuild/tasks/Targets/MergePluginDependencies.targets +++ b/src/Dataverse/Tasks/msbuild/tasks/Targets/MergeAssemblyDependencies.targets @@ -2,18 +2,11 @@ - - - $(MSBuildThisFileDirectory)..\StubForILRepack.targets - - - - + <_TalxisMergePrimaryRaw>$(IntermediateOutputPath)$(AssemblyName).dll <_TalxisMergeOutputDll>$(OutDir)$(AssemblyName).dll @@ -35,10 +28,10 @@ - true - $(MSBuildThisFileDirectory)StubForILRepack.targets + $(MSBuildThisFileDirectory)DisableILRepackAutoMerge.targets + Condition="'$(TalxisSkipAssemblyMerge)' != 'true'" + DependsOnTargets="MergeAssemblyDependencies" /> Date: Fri, 12 Jun 2026 16:53:19 +0200 Subject: [PATCH 7/7] refactor: align PDPackage ILRepack naming, document skip props MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bring the pre-existing PDPackage ILRepack integration into the same convention used across the rest of the repo: Targets: - DataverseILRepack (hook with inline logic) → split into MergePackageAssemblyDependencies (unprefixed worker) + _TalxisPdPackageAutoMergeHook (private hook) Properties: - DataversePackageRunILRepack + SkipPackageILRepack → unified to TalxisSkipAssemblyMerge (same switch used by Plugin/WorkflowActivity) - DataversePackageILRepackKeyFile → ILRepackKeyFile (generic, no Dataverse prefix on a tool-config property) Documentation: - Add previously undocumented TalxisSkipDuplicateGuidValidation and TalxisSkipQuickFindValidation to Solution/README.md - Add previously undocumented TalxisSkipPcfDependencyValidation and TalxisIgnoredPcfPrefixes to PDPackage/README.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/Dataverse/PDPackage/README.md | 14 ++++++++---- ...Build.Dataverse.PdPackage.ILRepack.targets | 22 +++++++++++++------ src/Dataverse/Solution/README.md | 5 +++++ 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/Dataverse/PDPackage/README.md b/src/Dataverse/PDPackage/README.md index b53be1c..54534d6 100644 --- a/src/Dataverse/PDPackage/README.md +++ b/src/Dataverse/PDPackage/README.md @@ -38,7 +38,7 @@ All `ProjectReference` items default to `ReferenceOutputAssembly=false` via `Ite ### ILRepack -`DataverseILRepack` (runs after `Build`) merges all non-Microsoft DLLs (excluding reference assemblies and `Newtonsoft.Json`) into the main output assembly using ILRepack.exe. Can be disabled with `DataversePackageRunILRepack=false` or `SkipPackageILRepack=true`. +`MergePackageAssemblyDependencies` (runs after `Build`) merges all non-Microsoft DLLs (excluding reference assemblies and `Newtonsoft.Json`) into the main output assembly using ILRepack.exe. Can be disabled with `true`. ### CMT package discovery @@ -70,12 +70,18 @@ All `ProjectReference` items default to `ReferenceOutputAssembly=false` via `Ite | Property | Default | Description | |----------|---------|-------------| -| `DataversePackageRunILRepack` | `true` | Runs ILRepack after build. | -| `SkipPackageILRepack` | _(none)_ | Set to `true` to skip ILRepack. | +| `TalxisSkipAssemblyMerge` | _(unset)_ | When `true`, skips the post-build `MergePackageAssemblyDependencies` ILRepack step. | | `ILRepackVersion` | `2.0.18` | ILRepack NuGet package version. | | `ILRepackExe` | `$(NuGetPackageRoot)ilrepack\$(ILRepackVersion)\tools\ILRepack.exe` | Path to ILRepack.exe. | | `ReferencedAssembliesDir` | `$(TargetDir)` | Directory scanned for assemblies to merge. | -| `DataversePackageILRepackKeyFile` | _(none)_ | Strong-name key file passed to ILRepack `/keyfile`. | +| `ILRepackKeyFile` | _(none)_ | Strong-name key file passed to ILRepack `/keyfile`. | + +### Validation + +| Property | Default | Description | +|----------|---------|-------------| +| `TalxisSkipPcfDependencyValidation` | _(unset)_ | When `true`, skips the `TalxisValidatePcfDependencies` check after publish. | +| `TalxisIgnoredPcfPrefixes` | _(unset)_ | Semicolon-separated PCF control prefixes to exclude from dependency validation. | ### CMT packages diff --git a/src/Dataverse/PDPackage/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.PdPackage.ILRepack.targets b/src/Dataverse/PDPackage/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.PdPackage.ILRepack.targets index 7481b43..6136f2a 100644 --- a/src/Dataverse/PDPackage/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.PdPackage.ILRepack.targets +++ b/src/Dataverse/PDPackage/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.PdPackage.ILRepack.targets @@ -2,15 +2,16 @@ 2.0.18 $(NuGetPackageRoot)ilrepack\$(ILRepackVersion)\tools\ILRepack.exe - true $(TargetDir) $([System.Text.RegularExpressions.Regex]::Replace('$(ReferencedAssembliesDir)', '[\\/]+$', '')) - + + $(TargetPath) - <_KeyFileSwitch Condition="Exists('$(DataversePackageILRepackKeyFile)')">/keyfile:"$(DataversePackageILRepackKeyFile)" + <_KeyFileSwitch Condition="Exists('$(ILRepackKeyFile)')">/keyfile:"$(ILRepackKeyFile)" <_ILRepackCommand Condition="$([MSBuild]::IsOSPlatform('Windows'))">"$(ILRepackExe)" <_ILRepackCommand Condition="!$([MSBuild]::IsOSPlatform('Windows'))">mono "$(ILRepackExe)" @@ -31,12 +32,19 @@ - - - + + + - + + + + diff --git a/src/Dataverse/Solution/README.md b/src/Dataverse/Solution/README.md index a24d907..12fb358 100644 --- a/src/Dataverse/Solution/README.md +++ b/src/Dataverse/Solution/README.md @@ -99,6 +99,11 @@ The package sets `ProjectType` to `Solution` and imports `Microsoft.PowerApps.MS ### Validation +| Property | Default | Description | +|----------|---------|-------------| +| `TalxisSkipDuplicateGuidValidation` | _(unset)_ | When `true`, skips the `TalxisValidateDuplicateGuids` check during build. | +| `TalxisSkipQuickFindValidation` | _(unset)_ | When `true`, skips the `TalxisValidateQuickFindViews` check during build. | + Schema validation via `ValidateSolutionComponentSchema` is **not wired automatically** -- invoke it manually (e.g. `dotnet build -t:ValidateSolutionComponentSchema`). No skip property is needed. ## Related Packages