web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Suggested project/workspace structure

(1) ShareShare
ReportReport
Posted on by 25

Hi,

suppose I'm developing an extension for Business Central using Visual Studio Code. Now, I want to have separate versions of my extension for BC16, BC17 and whatever may come in the future. The, in my opinion, dumbest approach would be to create separate folders for each version and duplicate the code.

Is there any suggested approach in Visual Studio code that would allow me to create a workspace with several "packages" for each BC versions that share (most of) the code, so that I could build separate packages based on the same source code?

Thanks

I have the same question (0)
  • Suggested answer
    darcnus Profile Picture
    247 on at

    This should help you get set up:

    https://code.visualstudio.com/docs/editor/multi-root-workspaces

  • tdittmar Profile Picture
    25 on at

    Hm, while it does seem to be a step in the right direction, I don't seem to get a few things right. Lets say I have a workspace for an extension I'm creating. Usually I'd set up my project ("AL: Go") and get started coding.

    Now let's assume that I already know I will need to create separate versions of my extension for different versions of BC. Let's say BC16 and BC17 are required. There will be some components specific to the BC version (source would reside in BC16/src and BC17/src respectively) and some code will also be shared between the two "versions" of the extension. Now what I've tried is to create the following folder structure:

    MyExtension

     +----> Workspace

                     +----> MyExtension.code-workspace

     +----> BC16

     +----> BC17

     +----> SharedSource

    So: The Workspace folder is there to host my multi-root workspace file. I've then started separate BC extension projects in the BC16 and BC17 folders and added them to the workspace. So far, so good. But now: How do I "tell" the BC16 and BC17 projects to include/reference/use the shared source code I'm putting into the ShareSource folder?

  • Suggested answer
    darcnus Profile Picture
    247 on at

    "When you’re working on extension A, from which Extension B is dependent – Extension B will recognize the symbols of Ext A without even having to create (compile) an app file – just because Ext B is in your Multi Root Workspace

    "When you’re debugging, you’re able to go to definition into al-files of other apps you’re debugging – not just the only-one-level-dal-files.  Just because you have the dependent app in your workspace.

    "Whenever you compile a main app, the symbol files of the dependent apps are updated with the new version of the main app.  Just because it’s in your multi-root workspace."

    Source: www.waldo.be/.../

  • tdittmar Profile Picture
    25 on at

    I've read Waldo's blog entry, but his scenario is a bit different - at least from what I understood. He has two extensions A and B which depend upon each other. He just develops both of them in the same workspace. In my case, however, extensions A and B do not actually depend on each other - they are the same extension, just for different BC versions (maybe which partly differing source code accounting for deprecations), but should "import" or "include" common source from a folder C. That folder is not an AL project itself, as it then would be version dependent.

    What I want to do is make extensions BC16 and BC17 from my above example the extension projects for different BC versions and folder C contain (part of) the source codes for BC16 and 17.

    I've tried that already: I created a workspace, added BC16, BC17 and SharedSource as folders to the workspace. BC16 and BC17 do compile fine, but they don't include any sources from SharedSource as the don't "know" they should import their sources from that folder.

    Basically my question is: Is there an easy way to release the same extension with different meta-data (such as the extension version number) for different BC versions without having to duplicate the source code?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,010

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,270 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,085 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans