vscode-powershell: Cannot attach debugger to PS 7.4.0 processes

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

Cannot attach debugger to an interactively selected PS 7.4.0 processes. This operation takes long time, then results in this error

image

PowerShell Version

PS C:\ROM\SET\VSCode\debug-psf> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.4.0
PSEdition                      Core
GitCommitId                    7.4.0
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visual Studio Code Version

1.84.2
1a5daa3a0231a0fbba4f14db7ec463cf99d7768e
x64

Extension Version

ms-vscode.powershell@2023.8.0
I have also tried the latest pre-release, same issue.

Steps to Reproduce

  • Select launch profile “PowerShell attach” (below)
  • Hit F5
  • Select one of PS 7.4.0 choices

Launch profile:

{
  "launch": {
    "version": "0.2.0",
    "configurations": [
      {
        "type": "PowerShell",
        "request": "attach",
        "name": "PowerShell attach",
        "processId": "${command:PickPSHostProcess}",
        "runspaceId": 1
      }
    ]
  }
}

Visuals

No response

Logs

No response

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Comments: 18 (7 by maintainers)

Most upvoted comments

Thanks for the update, that’s very helpful and has led me to find a bug (or two).

Here is the latest status, changed with new versions, still not working but differently

image

VSCode version:
1.85.1
0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
x64

ms-vscode.powershell version:
ms-vscode.powershell@2024.0.0

$PSVersionTable; $Host

Name                           Value
----                           -----
PSVersion                      7.4.1
PSEdition                      Core
GitCommitId                    7.4.1
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Name             : Visual Studio Code Host
Version          : 2024.0.0
InstanceId       : 8b608c97-927c-4d67-abc2-488fec552269
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-GB
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace