Build your app with a portable Program Database (PDB) output.

msbuild `
  /property:Configuration=Debug `
  /property:Platform=x64 `
  /property:DebugType=portable `
  /t:Clean,Build `
  /p:DeployOnBuild=true `
  /p:WebPublishMethod=Package `
  /p:PackageAsSingleFile=false `
  C:\dev\MyApp

In VSCode, Create ./.vscode/launch.config with this content.

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": ".NET Attach",
      "type": "clr",
      "request": "attach",
      "processId": "${command:pickProcess}"
    }
  ]
}

In VSCode,

  • Use <CTRL> + <SHIFT> + <P> to enter the command palette.
  • Then choose Start Debugging.
  • Then attach to your particular app.