Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running two projects at once in Visual Studio Code

Tags:

I develop web project. Server is node.js application written in TypeScript. Client also written in Typescript. I need two ability:

  1. to compile different projects with different compiler options in different folders.
  2. to debug both projects at the same time.

How can I do this?

like image 921
AndyGrom Avatar asked Jul 22 '16 15:07

AndyGrom


People also ask

How do I open two projects at the same time in Visual Studio?

To open a second instance of the integrated development environment (IDE), right-click on the Visual Studio icon in your dock or Applications folder, and select New Instance.

Can you run two instances of VS Code?

Ctrl + Shift + N will open a new window, while Ctrl + K then releases the keys, and pressing O would open the current tab in a new window. You can then use menu File → Open Folder to have two instances of Visual Studio Code with different folders in each window. ⌘ + Shift + N and ⌘ + K for Mac.

How do I run multiple files in VS Code?

Launch VS Code and press the “Ctrl” and “P” keys simultaneously to search for a file to open in the current project. Type in the file name. To open the new file in a temporary tab, click on it once. To open the new file in a separate window that you can choose to close manually, double-click it.


1 Answers

See our documentation on multitarget debugging: https://code.visualstudio.com/Docs/editor/debugging#_multitarget-debugging

In your launch.json, just create a compounds section that contains the targets you want to debug

{     "version": "0.2.0",     "configurations": [         {             "type": "node",             "request": "launch",             "name": "Server",             "program": "${workspaceRoot}/server.js",             "cwd": "${workspaceRoot}"         },         {             "type": "node",             "request": "launch",             "name": "Client",             "program": "${workspaceRoot}/client.js",             "cwd": "${workspaceRoot}"         }     ],     "compounds": [         {             "name": "Server/Client",             "configurations": ["Server", "Client"]         }     ] } 
like image 76
Matt Bierner Avatar answered Oct 13 '22 21:10

Matt Bierner