I've had a difficult time finding instructions on how to set up debugging within Visual Studio Code on Windows (10 if it matters) using the launch.json file.
Can someone define how to set this up?
To run or debug a simple app in VS Code, select Run and Debug on the Debug start view or press F5 and VS Code will try to run your currently active file. However, for most debugging scenarios, creating a launch configuration file is beneficial because it allows you to configure and save debugging setup details.
To enable the Debug Location toolbar, click in an empty part of the toolbar area and select Debug Location from the dropdown, or select View > Toolbars > Debug Location. Set a breakpoint and start debugging. When the breakpoint is hit, execution pauses and you can see the location in the Debug Location toolbar.
In Solution Explorer, right-click the project and choose Properties. In the side pane, choose Build (or Compile in Visual Basic). In the Configuration list at the top, choose Debug or Release. Select the Advanced button (or the Advanced Compile Options button in Visual Basic).
To debug using visual studio code you have to ensure that the configuration that you select in the debug tab is properly set up in the launch.json. The configurations in launch.json should look like this
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/netcoreapp1.0/Example.dll",
"args": [],
"cwd": "${workspaceRoot}/",
"stopAtEntry": false
}]
From my experience the most common problem is an incorrect path the program dll. I would double check that this path actually points to your compiled debug dll. If not, either modify this path or modify the target location of the debug url (this first is easier). Please comment if you have any questions I just worked through this myself.
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