Creating Windows.Forms.Form lock the debugger - v2019.11.0-preview
See original GitHub issueIssue Type: Bug
Add-Type -AssemblyName System.Windows.Forms
$Form = [System.Windows.Forms.Form]::new()
Set-PSBreakpoint -Variable 'Foo'
$Foo = 5
When Run in the “PowerShell Integrated Console” in any way you will get into DBG mode as expected but you cannot write anything in the console, In addition adding/removing breakpoints have no effect. Essentially making debugging unusable.
Extension version: 2019.11.1-CI.38936 VS Code version: Code 1.40.2 (f359dd69833dd8800b54d458f6d37ab7c78df520, 2019-11-25T14:54:45.096Z) OS version: Windows_NT x64 10.0.18362
System Info
| Item | Value |
|---|---|
| CPUs | Intel® Core™ i7-4770 CPU @ 3.40GHz (8 x 3392) |
| GPU Status | 2d_canvas: enabled flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled metal: disabled_off multiple_raster_threads: enabled_on oop_rasterization: disabled_off protected_video_decode: unavailable_off rasterization: enabled skia_renderer: disabled_off surface_control: disabled_off surface_synchronization: enabled_on video_decode: enabled viz_display_compositor: enabled_on viz_hit_test_surface_layer: disabled_off webgl: enabled webgl2: enabled |
| Load (avg) | undefined |
| Memory (System) | 15.93GB (7.72GB free) |
| Process Argv | |
| Screen Reader | no |
| VM | 67% |
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (1 by maintainers)
Top Results From Across the Web
Debugging a Windows Form - Visual Studio - Microsoft Learn
Follow a walkthrough to see how to create and debug a Windows Form, a common managed application. You can use C#, Visual Basic,...
Read more >Prepare to debug Windows Forms apps - Visual Studio ...
Take preparation steps to debug Windows Forms applications, which are created by the Windows Forms project template in Visual Studio.
Read more >Lock Controls - Windows Forms .NET Framework
In the Properties window of Visual Studio, select the Locked property and then select true. (Double-clicking the name toggles the property ...
Read more >Create and debug a basic form template using the InfoPath ...
This topic provides a walkthrough of creating a basic InfoPath managed code form template that works with the InfoPath 2003-compatible ...
Read more >Prepare to debug Windows Forms apps - Microsoft Learn
When you create a Windows Forms project with the project template, Visual Studio automatically creates required settings for the Debug and ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

So I’ve worked through this more and come up with a much better fix with the help of @daxian-dbw. Basically bad async/await usage was marshalling thread delegates through a synchronisation context, and the WinForms one in particular tried to force the work marshalling delegates back to the already-blocked pipeline thread.
Some simple changes have fixed that.
PS 5.1 and PS 7rc1 same behavior. VSCode PowerShell Preview Extension v2019.12.0 Once
$Form = [System.Windows.Forms.Form]::new()is run (while debugging or not) every following debug session on this console will not let you type while debugging.