Workspaces are a great way to work with Business Central apps. It allows you to work on multiple projects at the same time. In this post, you will learn how to create multi-root workspaces, their main benefits, and how to use them to save time when publishing dependencies.
- What Are Workspaces
- Main Benefits
- How To Create Workspaces
- Publish Full Dependency Tree
- Git Compatibility
What Are Workspaces
A Visual Studio Code workspace is basically one project opened containing files and folders.
When more than one project is opened at the same time it’s called a multi-root workspace. In Business Central, it means opening multiple apps in the same VS Code editor
The most important is working with multiple apps at the same time, without the need to switch between VS Code editors.
Symbols are shared, no need to recompile or download symbols from other apps. We can use new objects, procedures, variables, etc straight away.
We can publish the full dependency tree to Business Central. No need to do it individually. More details below.
How To Create Workspaces
Once you have one project opened. You can click on “Add Folder to Workspace…” to create a multi-root workspace. You can select projects from different locations. Once finished, save the workspace with “Save Workspace As…“.
Publish Full Dependency Tree
“Publish the full dependency tree” is a VS Code command that allows to install a BC app and all its dependencies at the same time.
When you publish a full dependency tree, only the apps within the tree will be published.
You have to be positioned (active editor) at the highest level of the tree to publish the dependency tree. For example, if you are positioned in the middle, apps from above won’t be published, only the ones below.
This is the command:
Once you click on it, you will see the results in the “OUTPUT” console. As you can see, it will publish the tree app by app. If it succeeded you will see a message saying “Done publishing the full dependency tree”.
You can control the sort order of your apps in this setting:
Workspaces work with Git. Each app has its own Git section. As you can see below, each section shows its changes where you can commit independently.
You can find more information about workspaces in the VS Code documentation:
Also, there is a new Postman extension for VS Code! I explain how to use it in the article below.
That´s all. Hope you find it helpful.