vscode-powershell: Debug adapter process has terminated unexpectedly

With the latest version of VS Code (1.4.0), and the latest version of PowerShell for VS Code (0.7.0) running on Windows 10 version 1607 OS Build 14393.51, whenever I run a PowerShell script, I get a ‘Debug adapter process has terminated unexpectedly’.

This is what I see in developer tools…

Ctrl+Alt+ keybindings should not be used by default under Windows. Offender: 40995 for PowerShell.ExpandAlias [Extension Host] Spell and Grammar checker active... [Extension Host] Default Settings [Extension Host] Code Actons Registering for: markdown [Extension Host] Code Actons Registering for: plaintext [Extension Host] powershell.exe started, pid: 8264, exe: C:\WINDOWS\Sysnative\WindowsPowerShell\v1.0\powershell.exe [Extension Host] Socket connected! Debug adapter process has terminated unexpectedly Debug adapter process has terminated unexpectedly: Error: Debug adapter process has terminated unexpectedly at Object.C [as create] (file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:34:19570) at file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:105:21677 at Object.m [as _notify] (file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:30:8153) at Object.B.enter (file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:30:11658) at i.Class.define._run (file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:30:12979) at i.Class.define._chainedError (file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:30:12338) at i (file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:30:10161) at i.Class.define.then (file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:30:13788) at Object.P.enter (file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:30:10230) at i.Class.define._run (file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:30:12979) at i.Class.define._setCompleteValue (file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:30:12673)

This is my launch.json which hasn’t been changed since I updated PowerShell for VS Code…

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "PowerShell",
            "type": "PowerShell",
            "request": "launch",
            "program": "${file}",
            "args": [],
            "cwd": "${file}"
        },
        {
            "name": "PowerShell x86",
            "type": "PowerShell x86",
            "request": "launch",
            "program": "${file}",
            "args": [],
            "cwd": "${file}"
        }
    ]
}

vscodedebug

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 2
  • Comments: 42 (14 by maintainers)

Commits related to this issue

Most upvoted comments

I just want to say that Powershell on osx might be the best thing to happen since sliced bread.

I just looked over a bunch of logs and I’m seeing some patterns in the error messages. Looks like the connections to the debug service are being rejected at times even though the Editor Services logs say that the socket was initialized successfully.

I’ll try to reproduce and fix the issue today. If I can’t immediately get a fix I’ll still try to make some tweaks to the debugger client so that it’s more resilient when a connection can’t be made immediately. I’ll ship an update in the next day or two after I’ve made some progress!

I think I fixed the problem! Filed an issue on the PowerShellEditorServices repo to track it: https://github.com/PowerShell/PowerShellEditorServices/issues/284

New release with the fix within 24 hours! I’ll close the bug after everyone has confirmed that the problem is gone.

I’ve just hit the same issue on VSCode 1.8.1 and PowerShell extension 0.8.0.

I seem to have solved this by uninstalling the PowerShell extension, reloading VSCode and reinstalling the extension. I can now debug PowerShell again.

Posting here as it’s the top result on Google when searching for this.

Hey @ConstantineK, #284 is open, you should subscribe to that issue to be notified when the issue is fixed.

@pcgeek86 got it, thanks man! I’ll take a look at these in a little while.