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.

Debugging session does not end, even after selecting "Stop Debugging"

See original GitHub issue

System Details

  • Operating system name and version: Windows 10 Creator (15063.540)
  • VS Code version: 1.15.1
  • PowerShell extension version: 1.4.1
  • Output from $PSVersionTable:

Name Value


PSVersion 5.1.15063.502 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} BuildVersion 10.0.15063.502 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

Copy / paste the following commands into the PowerShell Integrated Console, and paste the output here:

code -v
1.15.1
41abd21afdf7424c89319ee7cb0445cc6f376959

$pseditor.EditorServicesVersion
Major  Minor  Build  Revision
-----  -----  -----  --------
1      4      1      0

code --list-extensions --show-versions
ms-vscode.PowerShell@1.4.1

$PSVersionTable
See above

Issue Description

I am experiencing a problem with… ending a debugging session. I do the following steps (assuming a powershell script is already loaded and a breakpoint has been applied):

  1. Go to the Debug menu and select start debugging.
  2. My script in this case is one large main function with many sub functions. So I call the function from the “Terminal” screen. In this case it is: . ./Get-TFSUsers.ps1
  3. I then pass the needed parameters to the function. I pass up to 4 parameters. An example is as follows: Get-TFSGroupMembership http://TFSEnterprise:8080/tfs/Services Plugin -WriteOnly So this is the function name, the collection URL, the Project I want to get users from and the last is a switch to tell the script to get “writeonly” users. There is a second switch which is not shown here and I have not typically used.
  4. So my program now executes successfully and hits the breakpoint successfully.
  5. I will then F11 or F10 for a while and then decide I am done debugging as I have now what I need.
  6. I will then go to the Debug menu and select “Stop Debugging”.
  7. I will then go and select from the Debug menu “Remove all breakpoints”
  8. The breakpoints all go away.
  9. I can then either decide to make some changes to the script or just decide to run the script again. Either way it does not matter. The same result occurs.
  10. I now execute my script again from the “Terminal” screen and even if no breakpoint now exists, it will break at the location where my old breakpoints used to be.

I have tried all sorts of things to end the debug session, but nothing ends it. I have read all the tutorials on the VS Code debugger and nothing indicates that I am doing anything wrong or missing a step (so it seems). If there is something missing I could not for the life of me find it.

Finally the only way I could get the debugging session to end was to close out of VS Code and restart it again. This terminated the debug session. Otherwise, every time I ran the script it would continue to break at the non-existent breakpoint. If I added the breakpoint back and removed it again, this did not change a thing. I showed this to a couple of other VS Code users in my company and they also thought this was a bug. I am however skeptical that it is as I would think someone for sure would have seen this by now. However I could not see any mention of it. It seems like an in your face problem that would be noticed by everyone. So I am thinking I have done something wrong. I thought I would submit it anyway and see where it goes.

Attached Logs

I am not having any errors or crashes that exhibit this problem therefore I have not included any logs based on the URL given below. If however you need me to do so, I can follow your guidance as necessary to capture any information you may need.

Follow the instructions in the README about capturing and sending logs.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
bobbytreedcommented, Apr 1, 2020

Mine too. In fact even though you select Stop-Debugging, I noticed the [DBG] prompt never went away. Subsequent debugging entered further and futher nested prompts until breakpoints were outright ignored.

Had to type ‘q’ in the console window to exit out of all sessions

0reactions
msftbot[bot]commented, Apr 24, 2020

This issue has been marked as duplicate and has not had any activity for 1 day. It has been closed for housekeeping purposes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging session takes too long to finish
Here is my scenario: When debugging a specific winform project everything runs without error messages. At some time I choose to close the...
Read more >
"Debugging is being stopped" but is not yet complete
There is nothing to complete, only a debug session to get rid of. Clicking the "Stop Now" button will not immediately stop the...
Read more >
Ending a Debugging Session in Visual Studio - Windows drivers
To end a debugging session in Microsoft Visual Studio, from the Debug menu, choose Stop Debugging.
Read more >
Keep Visual Studio debugger ON when the browser is closed
If the “Stop debugger when browser is closed” checked, Visual Studio will terminate the debugger as soon as you close the browser. When...
Read more >
Terminating a debugging session (Integrated i Debugger) - IBM
Note: If the program was launched via a launch configuration and the launch configuration Terminate debug session on program completion check box was...
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