- Install latest mono here (don't use brew) http://www.mono-project.com/docs/getting-started/install/mac/
- Clone the dev branch of scriptcs or download from here
- Run
brew_build.sh
in thescriptcs
folder this will build the scriptcs binaries intoscriptcs\artifacts
- Install Visual Studio Code.
- Open VS code and install the
Mono Debug
extension.
- Open Visual Studio code
- Open in VS Code the folder that contains the script you want to debug.
- Add a break point in the main script or in a child script.
- Click
Debug
. - Click the play arrow next to
Debug
- Select
C# Mono
in the drop down. This will create a launch.json. - For
"program"
put the location of your scriptcs.exe. Use$root$/scriptcs/src/scriptcs/bin/debug/scriptcs.exe
replacing$root$
with the folder that your cloned scriptcs repo lives in. - For
"args"
put["$script$.csx","-D"]
replacing$script$ with the main script file.
Here is an example launch.json showing how it should look
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "mono",
"request": "launch",
"program": "/Users/glennblock/src/scriptcs/src/scriptcs/bin/debug/scriptcs.exe",
"args": ["test.csx","-D"],
"cwd": "${workspaceRoot}",
"preLaunchTask": "",
"runtimeExecutable": null,
"env": {},
"externalConsole": false
},
{
"name": "Attach",
"type": "mono",
"request": "attach",
"address": "localhost",
"port": 55555
}
]
}
Below is a screenshot showing a simple script being debugged in Visual Studio Code running on a mac