Skip to content

Enable plugin/workflow-activity dependency merging#48

Open
zekelinAlex wants to merge 7 commits into
TALXIS:masterfrom
zekelinAlex:users/alexander.zekelin/merge-plugin-dependencies
Open

Enable plugin/workflow-activity dependency merging#48
zekelinAlex wants to merge 7 commits into
TALXIS:masterfrom
zekelinAlex:users/alexander.zekelin/merge-plugin-dependencies

Conversation

@zekelinAlex

@zekelinAlex zekelinAlex commented May 12, 2026

Copy link
Copy Markdown
Contributor

Wires up ILRepack.Lib.MSBuild.Task in the Plugin and WorkflowActivity packages and runs the merge after every build. Each managed DLL in $(OutDir) gets folded into the main assembly so the Dataverse sandbox, which loads a single file and can't resolve siblings, sees every referenced type.

Sandbox-provided assemblies (Microsoft.Xrm.Sdk., System., mscorlib, Newtonsoft.Json) are excluded so they don't clash with the platform's own copies at runtime. Opt out per project with false.

ILRepack.Lib also ships its own AfterTargets="Build" merge target without an exclusion list, which we don't want firing. Each package points $(ILRepackTargetsFile) at a local no-op stub to silence it - the only knob the package exposes for that.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables dependency merging for Dataverse Plugin and WorkflowActivity projects by ensuring ILRepack is available at build time and adding an MSBuild target that merges all managed $(OutDir) DLLs into the primary output assembly (to satisfy Dataverse sandbox single-assembly loading constraints).

Changes:

  • Add ILRepack.Lib.MSBuild.Task as a dependency of the Plugin and WorkflowActivity NuGet packages (and inject it via .props).
  • Introduce TalxisMergePluginDependencies MSBuild target (in TALXIS.DevKit.Build.Dataverse.Tasks) to ILRepack output DLL dependencies into the main assembly.
  • Update Plugin/WorkflowActivity documentation to describe the new merge behavior and opt-out property.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Dataverse/WorkflowActivity/TALXIS.DevKit.Build.Dataverse.WorkflowActivity.nuspec Adds ILRepack package dependency for WorkflowActivity NuGet consumers.
src/Dataverse/WorkflowActivity/README.md Documents dependency merging behavior and new opt-out property.
src/Dataverse/WorkflowActivity/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.WorkflowActivity.props Injects ILRepack as a build-time PackageReference for consumer projects.
src/Dataverse/Tasks/msbuild/tasks/Targets/MergePluginDependencies.targets Adds the TalxisMergePluginDependencies MSBuild target that performs ILRepack merging post-build.
src/Dataverse/Tasks/msbuild/tasks/StubForILRepack.targets Provides a stub target file used to suppress ILRepack’s auto-merge behavior.
src/Dataverse/Plugin/TALXIS.DevKit.Build.Dataverse.Plugin.nuspec Adds ILRepack package dependency for Plugin NuGet consumers.
src/Dataverse/Plugin/README.md Documents dependency merging behavior and new opt-out property.
src/Dataverse/Plugin/msbuild/tasks/TALXIS.DevKit.Build.Dataverse.Plugin.props Injects ILRepack as a build-time PackageReference for consumer projects.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Dataverse/Tasks/msbuild/tasks/Targets/MergePluginDependencies.targets Outdated
Comment thread src/Dataverse/Plugin/README.md
Comment thread src/Dataverse/WorkflowActivity/README.md
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.<x>.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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants