This process works best when application is scaled down to one instance
cf ssh APP_NAME -c "curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l ~/vsdbg/vsdbg"
launch.json
as following (replace APP_NAME
){
"version": "0.2.0",
"adapter": "cf",
"adapterArgs": "ssh APP_NAME -c \"/tmp/lifecycle/shell /home/vcap/app 'bash -c \\\"~/vsdbg/vsdbg --interpreter=vscode\\\"'\"",
"languageMappings": {
"C#": {
"languageId": "3F5162F8-07C6-11D3-9053-00C04FA302A1",
"extensions": [ "*" ]
}
},
"exceptionCategoryMappings": {
"CLR": "449EC4CC-30D2-4032-9256-EE18EB41B62B",
"MDA": "6ECE07A9-0EDE-45C4-8296-818D8FC401D4"
},
"configurations": [
{
"name": ".NET Core Launch",
"type": "coreclr",
"processName": "dotnet",
"request": "attach",
"justMyCode": false,
"cwd": "~/app",
"logging": {
"engineLogging": true
}
}
]
}
DebugAdapterHost.Launch /LaunchJson:FULL_PATH_TO\launch.json
To have the debug adapter host logs appear in the Visual Studio Output Window enable logging from View -> Other Windows -> Command Window
and type:
DebugAdapterHost.Logging /On /OutputWindow
.vscode\launch.json
(Debug > Open Configurations). Replace APP_NAME
below{
"name": ".NET Core Remote Attach",
"configurations": [
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processName": "dotnet",
"pipeTransport": {
"pipeCwd": "${workspaceFolder}",
"pipeProgram": "cf",
"pipeArgs": [
"ssh", "APP_NAME", "-c", "\"/tmp/lifecycle/shell /home/vcap/app 'bash -c \\\"${debuggerCommand}\\\"'\"" ],
"logging": {
"engineLogging": true
},
"debuggerPath": "~/vsdbg/vsdbg"
}
}
],
}