Skip to content

Multi Component Repos

Peter McDonald edited this page Aug 12, 2026 · 2 revisions

Multi-component repos

One repository can hold several Dataverse projects at once — a plug-in, its web resources, a PCF control, the solution that ships them — each with its own folder and its own settings, all sharing one connection. This is how most real solutions end up structured, and the panel is built for it.

What makes a component

A component is any folder containing a dataverse-powertools.json. All of them are listed in the panel, root first.

my-solution/
  dataverse-powertools.json      ← root: the connection, prefix, environment
  MyPlugins/
    dataverse-powertools.json    ← a Plugins component
  webresources/
    dataverse-powertools.json    ← a Web Resources component
  MyControl/
    dataverse-powertools.json    ← a PCF component
  solution/
    dataverse-powertools.json    ← a Solutions component

Each component gets its own card in the panel, with only the buttons that apply to its type.

Connection inheritance — set it once

A subfolder component inherits the root's connection, tenant, publisher prefix and environment, so:

  • connect once, at the root, and every component uses it;
  • switch the root to another environment and every component follows.

Do not paste a connection string into a subfolder component's file. A component that carries its own connection stops following the root, and a later environment switch will leave it behind.

Adding a component

+ Add Component… in the panel, then pick the type. Two cases worth knowing:

  • Your project is currently at the workspace root and you want to add a second one: the wizard offers to move the existing project into a subfolder first, leaving a connection-only root. Accept it — that is the layout everything else assumes.
  • You already have subfolder components: the new one is created alongside them and inherits the root connection.

Which component does a command act on?

Commands resolve their target in this order, so the answer is predictable:

  1. An explicit target — you clicked a button on a component's card, or ran the command from a file's CodeLens or the Explorer context menu. That component wins.
  2. Exactly one component of the right type — used automatically. A repo with one plug-in never asks.
  3. Several of the right type, no explicit target — inferred from the active editor when the open file belongs to one of them; otherwise you get a quick pick.
  4. None of the right type — if the root's own settings claim that type (a pre-discovery layout), the command runs there; otherwise it explains rather than doing nothing.

The practical habit: have the file you care about open, or click the button on the card you mean.

Two components of the same type

Two plug-in components (or two web-resource components) in one repo is supported. Each keeps its own build, tests and Test Explorer entries; running one does not run the other.

What is per component, and what is not

Per component Per environment (same from any card)
Build, deploy, tests, typings, early-bound The connection, plug-in trace log level, captured profiles

Troubleshooting

A command asked me which component to use, and I did not expect it — you have more than one of that type and no explicit target. Open a file in the one you mean, or use its card's button.

One component deploys to the wrong environment — check whether its own dataverse-powertools.json contains a connectionString. If it does, it is self-contained and no longer following the root; remove that field to restore inheritance.

A component's card is missing — it needs a dataverse-powertools.json in its folder. Use + Add Component… rather than copying a file by hand, so the settings are complete and correct.

The card is collapsed and I cannot see its buttons — multi-component cards open minimised; click the caret to expand.

See also

Clone this wiki locally