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.
<PackageReference Include="TALXIS.DevKit.Build.Dataverse.WorkflowActivity" Version="0.0.0.1" PrivateAssets="All" />Or use the SDK approach:
<Project Sdk="TALXIS.DevKit.Build.Sdk/0.0.0.1">
<PropertyGroup>
<ProjectType>WorkflowActivity</ProjectType>
</PropertyGroup>
</Project>The package sets ProjectType to WorkflowActivity and configures ProjectTypeGuids for workflow activity recognition in Visual Studio.
- _ApplyWorkflowActivityVersionBeforeBuild (runs before
BeforeBuild) -- executesGenerateVersionNumberfollowed byApplyPluginVersionNumberto setAssemblyVersion,FileVersion,Version, andPackageVersionfrom Git. - AssemblyMergeDependencies (runs after
Build) -- uses ILRepack 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. By default, sandbox-provided assemblies are skipped:Microsoft.Xrm.Sdk*,Microsoft.Crm.Sdk.Proxy,Newtonsoft.Json,System.*,mscorlib,netstandard(configurable via$(AssemblyMergeExcludes)). 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 ofCodeActivitysubclasses. Disable per-project with<AssemblyMergeSkip>true</AssemblyMergeSkip>.
These targets are called by TALXIS.DevKit.Build.Dataverse.Solution when it discovers this project via ProjectReference:
- GetProjectType -- returns
WorkflowActivityso the Solution build knows how to handle this reference. - GetWorkflowActivityAssemblyInfo -- returns
WorkflowActivityRootPath,WorkflowActivityAssemblyId,TargetFramework,PublishFolderName, andAssemblyNamefor automatic workflow activity assembly metadata generation in the solution.
| Property | Default | Description |
|---|---|---|
ProjectType |
WorkflowActivity |
Marks the project as a workflow activity for reference discovery. |
Version |
(required) | Base version; major/minor are used for Git versioning. |
GitVersionNumberBranchPrefixes |
(none) | Optional <branch>:<prefix> map for build ordering (e.g. develop:1;feature/*:3). Prefix 2 is reserved for local builds. |
LocalBuildVersionNumber |
0.0.20000.0 |
Version used for local / non-CI builds. |
WorkflowActivityTargetFramework |
$(TargetFramework) or net462 |
Target framework used to locate the compiled workflow activity DLL. |
WorkflowActivityPublishFolderName |
publish |
Publish folder name under bin\<Configuration>\<TFM>\. |
WorkflowActivityAssemblyId |
(auto-generated) | Explicit GUID for the workflow activity assembly metadata; a new GUID is generated if empty. |
AssemblyMergeSkip |
(unset) | When true, skips the post-build AssemblyMergeDependencies ILRepack step. |
AssemblyMergeExcludes |
mscorlib;netstandard;Newtonsoft.Json;Microsoft.Xrm.Sdk;Microsoft.Crm.Sdk.Proxy |
Semicolon-separated assembly filenames (without .dll) to exclude from merging. Prefix patterns Microsoft.Xrm.Sdk.* and System.* are always excluded. |
- Depends on:
TALXIS.DevKit.Build.Dataverse.Tasks,Microsoft.PowerApps.MSBuild.Plugin,Microsoft.CrmSdk.CoreAssemblies,ILRepack.Lib.MSBuild.Task - Consumed by:
TALXIS.DevKit.Build.Dataverse.Solutionprojects viaProjectReference