TheSwamp

Code Red => .NET => Topic started by: Jeff_M on March 10, 2024, 02:48:17 PM

Title: Debugging>Breakpoint>Locals empty
Post by: Jeff_M on March 10, 2024, 02:48:17 PM
I have a project that recently started not behaving when debugging. The locals window never populates with any variables and hovering over a variable no longer display the value. Every other project I open works as expected, and this one used to work just fine.

Google returns a number of others having this issue, but all those seem to not be project specific. Regardless, I have tried every "solution" I found to no avail. This project is actually pretty small, the debug build is just a 45kb dll.

Any ideas as to what I may have done to this project to cause this?

Edited to add that I am using VS 2022 Pro. Also tested in VS 2022 Community.
Title: Re: Debugging>Breakpoint>Locals empty
Post by: kdub_nz on March 10, 2024, 03:50:38 PM
Jeff,
Can't recall ever seeing that issue, in Community.

Regards,
Title: Re: Debugging>Breakpoint>Locals empty
Post by: Jeff_M on March 10, 2024, 05:28:27 PM
Thanks, Kerry.

I finally gave up and created a new project on a different drive, copying the .cs files and folders from the original. A quick test and it was working as expected. I then copied all of the folders and files from the new to the original except the .sln & .csproj.user files and deleted the .vs file. It's back to working fine.

Prior to copying the files I used WinMerge to compare the 2 .csproj files. There were some things in the original project that I do not recall having added and are not in the new one so I deleted those. After testing the issue remained.

So even though I am back up and working, I still have no idea what caused the issue. I'm just happy it was with this small project instead of my much larger ones.
Title: Re: Debugging>Breakpoint>Locals empty
Post by: kdub_nz on March 10, 2024, 07:13:27 PM

Hi Jeff,
I was going to suggest creating new & copying code , but I knew that was a last resort that you would decide on yourself.

Great to hear there were happy endings.
Title: Re: Debugging>Breakpoint>Locals empty
Post by: It's Alive! on March 10, 2024, 08:04:56 PM
the only thing I can think of is a missing or incorrectly named .pdb file
Title: Re: Debugging>Breakpoint>Locals empty
Post by: CADbloke on March 13, 2024, 10:02:05 PM
Did you try restarting VS? I have a had a bug on the 2 machines I use where undo/redo stops working if I use the WPF designer but not consistently. I also recall losing debug hover values. VS is very modular these days which seems to mean only bits of it crash instead of the whole IDE. Still, when it works it works.
Title: Re: Debugging>Breakpoint>Locals empty
Post by: Jeff_M on March 14, 2024, 05:38:54 PM
@CADbloke, yes, restarted VS multiple times, rebooted laptop all with the same end result of not helping the issue. Thanks for the suggestion!
Title: Re: Debugging>Breakpoint>Locals empty
Post by: retsameht on March 14, 2024, 08:07:19 PM
A longshot, but try adding this to your  .csproj file:

Code: [Select]

<DebugType>portable</DebugType>

Title: Re: Debugging>Breakpoint>Locals empty
Post by: Atook on March 16, 2024, 07:00:35 PM
the only thing I can think of is a missing or incorrectly named .pdb file

Yup, try deleting the pdb file in your debug folder let VS compile a new one.