Skip to content

Debugger hangs when System.Windows.Forms objects are used #3410

Closed
@youngr137

Description

@youngr137

1623418243-1001617c-c46c-460d-a567-6024e60e18a91623416489171.zip

System Details Output

VSCode version: 1.57.0 b4c1bd0a9b03c749ea011b06c6d2676c8091a70c x64

VSCode extensions:

ms-vscode.powershell@2021.5.1
vscodevim.vim@1.21.1

PSES version: 2.4.3.0

PowerShell version:

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


System Info:
Edition	Windows 10 Home
Version	20H2
Installed on	‎03/‎10/‎2020
OS build	19042.1052
Serial number	MP1A8Y87
Experience	Windows Feature Experience Pack 120.2212.2020.0

Issue Description

Visual Studio was installed and ran for some days without problems. I saw a message indicating that an update was applied. After that I got the problem described below.
Script is:

Add-Type -AssemblyName 'System.Windows.Forms'

$contextFilmStripAlbumPictureBoxMenuStrip = New-Object System.Windows.Forms.ContextMenuStrip
$null = $contextFilmStripAlbumPictureBoxMenuStrip.Items.Add("Single larger picture slideshow")
Write-Host 'Hello world'

I set a breakpoint on line 4 ($contextFilmStripAlbumPictureBoxMenuStrip = New-Object System.Windows.Forms.ContextMenuStrip)
Start debugging with F5. Stops on line 4 with highlight. Press F10 and debugger appears hung. (Run menu has grayed out the F10 and F11). These keys do not work. On occasions pressing F5 then 'Hello World' appears on terminal. Terminal prompt> is not hung.

Expected Behaviour

Expected using F10 to step over each line of code in script.

Actual Behaviour

After a number of steps Visual Studio hangs. F10,F11 are greyed out in the Run menu and the keys do not work

Attached Logs

Set to diagnostic and supplied.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions