I have setup my project in vscode with a root "solution" containing a global.json defining the sub projects. These are currently my web app, and a class library.
That works fine, and I have setup the following launch.json under the root directory in an attempt to debug my web app:
{
"version": "0.2.0",
"configurations": [
{
"name": "WebApp",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "",
"program": "${workspaceRoot}/WebApp/bin/Debug/netcoreapp1.0/WebApp.dll",
"args": [],
"cwd": "${workspaceRoot}/WebApp/",
"stopAtEntry": false,
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"osx": {
"command": "open"
}
}
}
]
}
I have two issues with this.
I had to remove the preLaunchTask build because it tries to build from the root dir. Not ideal but I can work around that by building manually first.
When the debugger launches, it fails to find the source code because its looking in the root dir, rather than the sub project. This one is a show stopper because I can't use breakpoints at all without the source loaded.
Is there a way around these issues?
Update: 9th August 2016
I took the issue to Omnisharp directly and got a bit further, being able to debug an app and a separate library under one solution. Haven't quite hit the jackpot on multiple executable projects under one solution yet though. Unfortunately I'm not pursuing that project any longer but hopefully this can help someone towards a total solution.
Link to discussion and code samples: https://github.com/OmniSharp/omnisharp-vscode/issues/460#issuecomment-228392486
Or you can just select multiple folders and then click open. Save this answer. Show activity on this post. Just put your projects in the same folder and simply open that folder in vscode.
Visual Studio allows you to specify how more than one project is run when you press F5 (Start with Debugging), or Ctrl+F5 (Start without debugging), or use the toolbar button to launch your application.
I had the same problem, and I have the following structure for my solution:
global.json
|src
--|TestApp
----Program.cs
----project.json
--|ExtLib
----ExtLibClass.cs
----project.json
in the task.json file in the .vscode folder you have to set the options value like this:
"command": "dotnet",
"isShellCommand": true,
"options": {
"cwd": "${workspaceRoot}/src/TestApp"
},
and in the launch.json file in the .vscode folder you have to change the program property like this:
"configurations": [
{
"name": "TestApp Debug",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/src/TestApp/bin/Debug/netcoreapp1.0/TestApp.dll",
"args": [],
"cwd": "${workspaceRoot}/src/TestApp",
So I can debug multiple projects in a solution in visual studio code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With