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.

local variables in WinForms projects are not captured by debugger

See original GitHub issue

Created based on this discussion.

.NET version

net6.0-windows; net7.0-windows; net472

V.S.

Microsoft Visual Studio Community 2022
Version 17.4.2
VisualStudio.17.Release/17.4.2+33122.133
Microsoft .NET Framework
Version 4.8.09032

17.4.1 and 17.5.p1 - same behavior.

Windows.

OS Name	Microsoft Windows 11 Home
Version	10.0.22621 Build 22621

Issue description

V.S. Debugger not capturing local variables in any WinForms .Net / .net framework projects. In console projects all are ok: Snipaste_2022-12-08_08-40-36 Reset settings and repair installation - nothing helps.

developercommunity issues: https://developercommunity.visualstudio.com/t/Net-local-variables-not-captured-by-deb/10216016 (closed in favor of next one) https://developercommunity.visualstudio.com/t/CS0103-in-the-watch-window-for-local-var/10222843

Steps to reproduce

Any WinForms project.

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
Olina-Zhangcommented, Dec 9, 2022

Verified it in different VS versions: cannot repro in 17.3.7 release build and previous versions. Repro in 17.4.2 release build for Winforms .Net Core and .Net framework apps. Doesn’t repro in WPF app. image image

2reactions
Olina-Zhangcommented, Dec 10, 2022

What version of windows did you test on?

My VM is Win10 22H2 with different release Visual Studios installed, from 17.4.2, this issue is reproduced.

Read more comments on GitHub >

github_iconTop Results From Across the Web

variable values not showing during debug vs 2019 16.2.4
As shown in the code below, I have set two break points, one where I add together two local variables, and one when...
Read more >
Debugger doesn't recognize local variables.
I'm trying to debug a method and the debugger doesn't recognize almost any variables. Please help me reroduce this error.
Read more >
Visual studio debug variable not working
I have some strange issue while debugging. I tried resetting options, changing debug options. Reinstall multiple times following official ...
Read more >
7 Ways to Look at the Values of Variables While ...
Hover over a variable to see its value. The most commonly used way to look at variables is the DataTip. When stopped in...
Read more >
Debugger, watch: local variable is not captured in Android ...
Debugger, watch: local variable is not captured in Android setOnClickListener lambda · 1.Have some code that you want to debug. · 2. put...
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