Where is the 'launch.json' file in Visual Studio Code?

Viewed 21777

The launch.json file should be inside the .vscode folder, but it is not present there.

How can I get this file so that I can modify the configurations?

3 Answers

As described in the Launch Configurations section of the Visual Studio Code documentation:

VS Code keeps debugging configuration information in a launch.json file located in a .vscode folder in your workspace (project root folder) or in your user settings or workspace settings.

To create a launch.json file, click the create a launch.json file link in the Run start view.

As of Visual Studio Code 1.56:

Visual Studio Code screenshot for create launch.json file link

Once that's created, it should now be available under your workspace's .vscode folder.

VS Code screenshot of File Explorer with launch.json file

Click on the debug side bar to open the debugging options. Then either the cog icon at the top, or the create a launch.json file link below the big blue button. If the launch.json file is present, it will open it otherwise it will generate one.

Warning: if you try to create an empty one (or one with an invalid content), trying to get to that file through the "Create a launch.json file" would not do anything.

See issue 133327.

That will be fixed with VSCode 1.61 (Sept. 2021): at least, that existing file will be opened when you click on "Create a launch.json file".

Related