Enable plugin/workflow-activity dependency merging#48
Open
zekelinAlex wants to merge 7 commits into
Open
Conversation
There was a problem hiding this comment.
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.Taskas a dependency of the Plugin and WorkflowActivity NuGet packages (and inject it via.props). - Introduce
TalxisMergePluginDependenciesMSBuild target (inTALXIS.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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.