I'm trying to setup debugging on OSX environment using .NET Core RC2 and Visual Studio Code. The following error is given when trying to run the debugger.
Couldn't find 'project.json' in current directory
Currently I've setup launch.json (see below) and chosen .NET Core Launch (web) in Visual Studio Code. As my project is in a folder called Core and sharing space with two other folders my structure looks like this.
Structure
--.vscode
------ launch.json
------ tasks.json
-- Core
-- Core.Data
-- Core.Service
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/Core/bin/Debug/netcoreapp1.0/Core.dll",
"args": [],
"cwd": "${workspaceRoot}/Core",
"stopAtEntry": false
},
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/Core/bin/Debug/netcoreapp1.0/Core.dll",
"args": [],
"cwd": "${workspaceRoot}/Core",
"stopAtEntry": false,
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open",
"args": "-a chrome ${auto-detect-url}"
},
"linux": {
"command": "xdg-open"
}
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processName": "<example>"
}
]
}
Folder structure
I needed to add this code
tasks.json
"options":{
"cwd": "${workspaceRoot}/Core"
}
None of the answers helped me. I just specified the whole path to project.json and it began to work fine.
tasks.json
{
"version": "0.1.0",
"command": "dotnet",
"isShellCommand": true,
"args": [],
"tasks": [
{
"taskName": "build",
"args": [
"${workspaceRoot}\\project.json"
],
"isBuildCommand": true,
"problemMatcher": "$msCompile"
}
]}
So, for this particular question it would be
"args": [
"${workspaceRoot}\\Core\\project.json"
],
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