The launch startupcompany does not work when debugging
1. Describe the bug
I would like to debug in a specific company using the new startupcompany setting. It does not work...
References:
- https://www.yammer.com/dynamicsnavdev/#/Threads/show?threadId=1963454374150144
- https://learn.microsoft.com/en-us/dynamics365-release-plan/2022wave2/smb/dynamics365-business-central/launch-specific-company-visual-studio-code

2. To Reproduce Steps to reproduce the behavior:
VS Code part
- I always work with workspaces. These workspaces might contain different project folders
- Each project folder contains a /.vscode/launch.json file which is empty (
{}) - Instead of managing my configurations on project or workspace level, all configurations are part of my personal settings.json
- This has worked for years, without the latest addition to manage launch.json data on other levels
- With the latest addition of the startupcompany parameter (see https://learn.microsoft.com/en-us/dynamics365-release-plan/2022wave2/smb/dynamics365-business-central/launch-specific-company-visual-studio-code), I've included the startupcompany in my configurations
BC Part
- My current user is linked to company 1 (my settings)
VS Code
- Whenever I publish with/without debugging and select a configuration with a startupcompany different then company 1 (the default of the user in BC), it seems to be totally ignored.
- The web client opens after the publish/debug step and uses the company as specified in the BC user settings, instead of the startupcompany specified in the launch configurations.
3. Expected behavior
-
startupcompanyshould be supported in all 'publish with/without debugging' commands.
4. Actual behavior
https://user-images.githubusercontent.com/25268332/205255214-82e4746b-a380-4aef-9a27-a8ab9d789eae.mp4
5. Versions:
- AL Language: v10.1.707468
- Visual Studio Code: 1.73.1
- Business Central: US Business Central 21.1 (Platform 21.0.48357.49378 + Application 21.1.48363.48789)
As I have heard, you also need to specify a startup object in your launch.json to make the startup company work.
@NKarolak Thanks a lot, this made it work.
I'd expect MS to at least either proper document this setting or warn about incomplete settings when creating Configurations in launch.json files. This would have saved me a lot of time and frustrations :)
Hi @fvet, @NKarolak is right the startup object has to be specified in order for the startup company to work. However, we will take this issue into account and either change the behaviour since it is misleading to you or update the docs.
Thank you!