- Open VSCode in the primary project folder
- Install C# for VSCode if not already done
- This contains the .NET Core Debug templates
- This might be overkill for now, but it work
- Configure debugger as
.NET Core
- This should create a
launch.json
under.vscode
in the current workspace root folder
- This should create a
- Try running a debug session
- This will result in the error
Could not find the preLaunchTask 'build'.
PressConfigure Task Runner
- Don't worry if you miss click and dismiss the promt, it will show the same error again.
Configure Task Runner
will ask for a Task Runner again pick.NET Core
- This will create a
task.json
that should look similar to the following
- This will result in the error
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"taskName": "build",
"command": "dotnet build",
"type": "shell",
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
}
]
}
Almost done. Now we need to install the .Net Core Debugger. Open the VSCode command prompt with either (Shift + Command + P) on macOS or (Shift + Control + P) on Windows and run
> Debug: Download .NET Core Debugger
Some versions of the .NET Core
task templates have a bug where the command property is "command": "dotnet",
instead of "command": "dotnet build",
command is what is past to the shell. So, Just dotnet by it's self will fail with the error code 129. If you get this error make sure the command has the build parameter.
If you want to pass arguments to the command you can use the task args property; I typically add args below the command property.