TALXIS.DevKit.Build.Dataverse.CodeApp
1.4.0
Prefix Reserved
dotnet add package TALXIS.DevKit.Build.Dataverse.CodeApp --version 1.4.0
NuGet\Install-Package TALXIS.DevKit.Build.Dataverse.CodeApp -Version 1.4.0
<PackageReference Include="TALXIS.DevKit.Build.Dataverse.CodeApp" Version="1.4.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="TALXIS.DevKit.Build.Dataverse.CodeApp" Version="1.4.0" />
<PackageReference Include="TALXIS.DevKit.Build.Dataverse.CodeApp"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add TALXIS.DevKit.Build.Dataverse.CodeApp --version 1.4.0
#r "nuget: TALXIS.DevKit.Build.Dataverse.CodeApp, 1.4.0"
#:package TALXIS.DevKit.Build.Dataverse.CodeApp@1.4.0
#addin nuget:?package=TALXIS.DevKit.Build.Dataverse.CodeApp&version=1.4.0
#tool nuget:?package=TALXIS.DevKit.Build.Dataverse.CodeApp&version=1.4.0
TALXIS.DevKit.Build.Dataverse.CodeApp
MSBuild integration for Power Apps code-first canvas app projects. Automates the npm install / npm run build lifecycle, copies the compiled dist/ output into the correct location, and exposes metadata targets that allow Solution projects to discover, generate .meta.xml, and package canvas apps into the solution .zip.
Installation
<PackageReference Include="TALXIS.DevKit.Build.Dataverse.CodeApp" Version="0.0.0.1" PrivateAssets="All" />
Or use the SDK approach:
<Project Sdk="TALXIS.DevKit.Build.Sdk/0.0.0.1">
<PropertyGroup>
<ProjectType>CodeApp</ProjectType>
<AppName>myapp</AppName>
</PropertyGroup>
</Project>
Prerequisites
- Node.js and npm must be available in
PATH. - A
package.jsonmust exist in the project root. - The
npm run buildscript must produce output in adist/folder. - A
power.config.jsonfile must exist, describing the app schema name and metadata used byGenerateCodeAppMetaXml.
How It Works
Build-time targets
- CheckCodeAppPrereqs -- validates that
package.jsonexists and thatnode/npmare available in PATH. Runs only whenRunNodeBuildistrue(auto-detected from the presence ofpackage.json). - BuildCodeApp (runs before
Build, depends onCheckCodeAppPrereqs) -- executesnpm installfollowed bynpm run buildin the project root directory. - CopyCodeAppDist (runs after
Build) -- copies thedist/folder to$(OutputPath)$(AppName)\. Fails the build ifdist/is missing or ifAppNameis not set. - CopyCodeAppDistPublish (runs after
Publish) -- same as above, but copies to$(PublishDir)instead.
Integration targets
These targets are called by TALXIS.DevKit.Build.Dataverse.Solution when it discovers this project via ProjectReference:
- GetProjectType -- returns
CodeAppso the Solution build knows how to handle this reference. - GetCodeAppOutputs (depends on
Build) -- returns the path to the compileddist/folder along withAppNameandConfigPath(location ofpower.config.json) metadata. The Solution project uses this to callGenerateCodeAppMetaXmland produce the.meta.xmlfile for PAC packaging.
What happens in the Solution project
When a Solution project has a ProjectReference to a CodeApp project, the following happens automatically during solution build:
- ProbeCodeApps discovers the CodeApp reference by calling
GetProjectType. - BuildCodeApps calls
GetCodeAppOutputs, which triggers the full CodeApp build (npm install + build). - PrepareCodeAppsSources generates
.meta.xmlviaGenerateCodeAppMetaXml, adds aRootComponententry (Type 300) toSolution.xml, and ensures theCanvasAppsnode exists inCustomizations.xml. - CopyCodeAppsToMetadata copies the CodeApp dist output into the solution metadata
CanvasApps/folder before PAC packages the solution.
The CodeApp reference is automatically filtered out of the standard ResolveProjectReferences pipeline to avoid unnecessary assembly resolution.
MSBuild Properties
| Property | Default | Description |
|---|---|---|
ProjectType |
CodeApp |
Marks the project as a code app for reference discovery. |
AppName |
(required) | Application name; used as the output folder name and in .meta.xml generation. |
RunNodeBuild |
Auto-detected | Set to true if package.json exists in project root; set explicitly to override. |
power.config.json
The GenerateCodeAppMetaXml task reads this file to generate the .meta.xml required by PAC. Place it in the project root. The task scans dist/ for all files, maps extensions to MIME types (50+ extensions supported), and produces CodeAppPackageUri entries.
Learn more about Target Frameworks and .NET Standard.
-
- TALXIS.DevKit.Build.Dataverse.Tasks (>= 1.4.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.