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.

Breakpoint not being hit when attaching to debugger

See original GitHub issue

System Details

Windows10

System Details Output


Issue Description

I am experiencing a problem as the breakpoints are not getting hit when attaching debugger to different pwsh window.

Expected Behaviour

–It should stop at breakpoint

Actual Behaviour

– It just executed without halting

Attached Logs

vscode-powershell.log StartEditorServices.log EditorServices.log

MicrosoftTeams-image (1) MicrosoftTeams-image

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Noctrancommented, Jul 28, 2022

I experience the same problem and can agree with the above descriptions.

0reactions
IAmIlliestcommented, Jun 17, 2021

Yep, confirming the same symptoms as Leo above. Probably unrelated, but just in case it isn’t, I’m using Conda environments.

For what it’s worth, I’m doing the bits below in a condition where VS Code PS Extension is no longer able to attach to another host process (it times out). Using PS 7.1.3:

  • I can attach to the other (first) PS Host process from a second (external to VS Code) PS instance.
  • I can also still attach to the other (first) PS Host from the internal terminal in VS Code.
  • Once attached, I can set breakpoints in the other (first) PS Host process for the script and see that Get-PSBreakpoints is showing them.
  • I can then seemingly successfully enter to begin to debug the runspace that the script will be executing in on the other (first) PS Host process.
  • I then run the script, initiating it ‘locally’ on the other (first) PS Host process.
  • In both cases, those breakpoints will be ignored.

As such, it seems like the issue is not just VS Code or the PS extension in VS Code, Something is happening that is making the debugging engine for PS ‘non-responsive’ to breakpoints, or else it isn’t attaching properly (despite appearing to report that it is).

Or, I’m missing something else…

Read more comments on GitHub >

github_iconTop Results From Across the Web

breakpoint will not currently be hit, why not? - Stack Overflow
Stop debugging (press red square icon) in Visual Studio · Clean Solution · Build Solution · Tools > Attach to Process (or start...
Read more >
Not hitting breakpoints when attaching to process with debugger
Hi,. Firstly, please make sure the debug attribute is true in web.config file. If the debugger doesn't load the .pdb file, ...
Read more >
Debug -> Attached to Process not hitting break points for ...
I refresh the web page (in Chrome) and no new dotnet.exe processes start, and I remain attached to the process but still no...
Read more >
Solving error "the breakpoint will not currently be hit" in Visual ...
Go to Debug from the menu bar · Click on Attach to Process · Near the Attach to option, click on the Select...
Read more >
If breakpoints are not hit when debugging | GE Digital
Breakpoints should be used and hit when debugging. If your breakpoints are not hit during a debugging session, follow the information below to...
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