question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.

Summary

REF: https://github.com/PowerShell/vscode-powershell/issues/3394#issuecomment-904786408

After attempting to resolve my issue with the pre-release version of the extension, the debugger started failing again. Per @rjmholt 's suggestion, I am opening a new issue for tracking.

PowerShell Version

Both PS 5.1 and 7 have issues.

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


Name                           Value                                                                                                                                                                                                                                                                                
----                           -----                                                                                                                                                                                                                                                                                
PSVersion                      5.1.18362.1474                                                                                                                                                                                                                                                                       
PSEdition                      Desktop                                                                                                                                                                                                                                                                              
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                                                                                              
BuildVersion                   10.0.18362.1474                                                                                                                                                                                                                                                                      
CLRVersion                     4.0.30319.42000                                                                                                                                                                                                                                                                      
WSManStackVersion              3.0                                                                                                                                                                                                                                                                                  
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                                                                                                  
SerializationVersion           1.1.0.1

Visual Studio Code Version

1.59.1
3866c3553be8b268c8a7f8c0482c0c0177aa8bfa
x64

Extension Version

ms-vscode.powershell@2021.8.0
ms-vscode.powershell-preview@2021.8.1

Steps to Reproduce

Scenario 1 (PowerShell 5.1)

  1. Close all VSCode instances
  2. Open new instance with no folder opened
  3. Create a new PowerShell script
  4. Past in script below (do not save)
function Write-SomeStatus {
    # Breakpoint on following line
    Write-Host 'Some Status'
}

Write-SomeStatus
  1. Press F5

Expected: Breakpoint is hit Actual: Breakpoint is skipped and script contents + “Some Status” is written to terminal

Scenario 2 (PowerShell 5.1)

  1. Save the script from Scenario 1 to C:\temp\DebuggingTest.ps1
  2. Readd the breakpoint to line 3 (as indicated)
  3. Press F5
  4. Debugger starts and attaches correctly
  5. Press F5 to run to completion
  6. Run Write-SomeStatus from the terminal directly
  7. Debugger attaches to breakpoint at line 3
  8. Press F5 to continue and the debugger hangs (screenshot below)

Visuals

Debugger attaches when adding new Write-Host line: image

Debugger hangs after calling from terminal directly: image

Logs

EditorServices.log StartEditorServices.log vscode-powershell.log

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:49 (26 by maintainers)

github_iconTop GitHub Comments

1reaction
andschwacommented, Sep 2, 2021

Hey…it’s a-working. It just might be a bit fragile (and it needs tests).

1reaction
liberdiscommented, Sep 1, 2021

I came here trying to make heads or tails of the wide variety of odd behavior the 1.59.1 update seems to have brought my 5.1 debugging experience. Fairly consistently now in my module (no unnamed files) when i hit a breakpoint and then F5 to continue my integrated console hangs. This can’t possibly be by design, I have tried clicking all the “stop” buttons to no avail

Read more comments on GitHub >

github_iconTop Results From Across the Web

7 Debugging Techniques to Speed Up Troubleshooting | Toptal
In this article, Toptal Freelance Java Developer Flavio Pezzini shows us techniques that can prevent bugs and make finding issues in production much...
Read more >
Troubleshoot Breakpoints in the Visual Studio Debugger
This section provides information to troubleshoot issues when the debugger isn't displaying any warnings – the breakpoint is a solid red ...
Read more >
Troubleshooting common PHP debugging issues | PhpStorm ...
This section provides the list of solutions and workarounds for common problems with Debugging in PhpStorm.
Read more >
Troubleshooting vs Debugging: What's the Difference & Best ...
Debugging is a subset of troubleshooting. It requires finding problems as they relate to computer code. As a programmer, when you are tasked ......
Read more >
Metal Debugger Issues | Apple Developer Forums
I have been unable to use the metal debugger ever since Apple released Xcode 12 as an update on the app store. It...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found