Azure / Azure/azure-functions-powershell-worker

Local debugging in VS Code fails after app restart

Open
#538 16 comments 4 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
215
Forks
61
Avg merge
21h 4m
Merged PRs (30d)
6

Description

Repro steps:
1. Start a PowerShell Function app in VS Code by F5.
2. Wait for the app to start. Invoke a function or do not invoke any function - does not seem to matter.
3. Stop the app: hit the Disconnect button or push Ctrl-C in the terminal.
4. Start the app again by F5. About 2-5 seconds after the app start, it stops and the following message appears in the terminal window: `Debug-Runspace: You cannot debug the default host Runspace using this cmdlet. To debug the default Runspace use the normal debugging commands from the host.`

Further attempts to start the app fail with the same error, until VS Code is restarted.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure by starting a PowerShell Function app in VS Code with F5, stopping it with Disconnect or Ctrl-C, and starting it again. Begin with the VS Code launch and terminal debugging flow around the reported Debug-Runspace message; done means repeated restarts succeed without the error and do not require restarting VS Code.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.