Skip to content

Session crash when a breakpoint is hit in the console while not in debug mode #620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
daviwil opened this issue Mar 24, 2017 · 1 comment
Labels
Issue-Bug A bug to squash.
Milestone

Comments

@daviwil
Copy link
Contributor

daviwil commented Mar 24, 2017

Repro steps

  1. Open a .ps1 file and set breakpoints using Set-PSBreakpoint -Script <script> -Line <##>
  2. Run the script from the console by invoking with its script name
  3. PowerShell hits the breakpoint, session crashes and prompts to restart
@daviwil daviwil added the Issue-Bug A bug to squash. label Mar 24, 2017
@daviwil daviwil added this to the 0.11.1 milestone Mar 24, 2017
@Jrouzies
Copy link

Hello, I confirm, same issue.

I posted this in wrong Git (on vcode directly) if it can help :

**ello !

The new version with PowerShell is a lot better, still I cannot debug my script by running it through Terminal because PowerShell App will crash.

VSCode Version: 1.10.2
OS Version: Windows Server 2012 R2
Steps to Reproduce:

Have Powershell module for VSCode installed
Open Powershell script that use Args
Press F5 to debug once (do whatever, stop debug)
Put debug point in the script
Now I want to run my script with args :
-so I type in the Powershell terminal the command with args (with a debug point in the script)
-As soon as I hit enter to run the command, "Powershell" application crash
You can see on picture bellow 👍

image

Crash detail :

Problem Event Name: PowerShell
NameOfExe: powershell.exe
FileVersionOfSystemManagementAutomation: 6.3.9600.17400
InnermostExceptionType: System.InvalidOperationException
OutermostExceptionType: System.InvalidOperationException
DeepestPowerShellFrame: unknown
DeepestFrame: rotocol.MessageProtocol.ProtocolEndpoint.SendEvent
ThreadName: unknown
OS Version: 6.3.9600.2.0.0.16.7
Locale ID: 2057

This is really blocking to debug, because using F5 and then typing args is loss of time (plus not mandatory args are not used).

Thanks !**

daviwil added a commit to daviwil/PowerShellEditorServices that referenced this issue Mar 31, 2017
This change fixes a crash that occurs when a breakpoint is hit at a time
when the debugger is not active.  This is caused by some event handlers
being registered prematurely in the DebugAdapter before it gets activated
by VS Code.

Fixes PowerShell/vscode-powershell#620.
@daviwil daviwil modified the milestones: Next Patch Update, 0.12.0 Apr 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash.
Projects
None yet
Development

No branches or pull requests

2 participants