4

I'm using VS Code with the vscode-solution-explorer to develop a .NET solution.

For debugging, I've configured my .vscode/launch.json file to run a build solution task and to execute a specific C# project (.csproj file).

My problem is: this .NET solution uses the Microservices approach, so I have ~50 Web API projects and each time I need to debug a specific API, I need to open the .vscode/launch.json file and replace the project name in 4 different places.

What I would like to do is the same that I do in Visual Studio: I right-click in the project and select "Set as StartUp project", so every time I press F5 it will run this selected project.

My launch.json looks likes this:

{ "version": "0.2.0", "configurations": [ { "name": "MyProject", "type": "coreclr", "request": "launch", "preLaunchTask": "build", "program": "${workspaceFolder}/MyProject/bin/Debug/netcoreapp3.0/MyProject.dll", "args": [], "cwd": "${workspaceFolder}/MyProject.csproj", } ] } 
8
  • Why not using Visual Studio (community/pro/enterprise) ? Commented Dec 17, 2019 at 14:11
  • i think this can't be done from visual studio code. Commented Dec 17, 2019 at 14:13
  • @Cid My team is trying to switch to VS Code for many reasons (costs, features, lightweight, etc.) Commented Dec 17, 2019 at 14:13
  • @cash VS community is free Commented Dec 17, 2019 at 14:13
  • Well the difference between Code and VS is when you set a project as a startup project, VS doing the config modification task for you. So maybe there might be an extension to do it on Code. Commented Dec 17, 2019 at 14:14

1 Answer 1

1

You can create multiple configurations in launch.json file. Check this post: How do I designate a startup project in VS Code?

Hope this helps.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.