Reputation: 2579
I'm using VS2017, attaching to a running process (a Windows service) and breaking on a breakpoint. When I do that, some variables that should be in scope are not recognized by the debugger - not shown in the Locals or Autos windows, no tooltip in the editor, can't add a watch or evaluate them in the Immediate window. In these cases, I'm getting an error "CS0103: The name '...' does not exist in the current context"
The executable and the referenced project where the breakpoint is placed are both built in the Debug configuration, optimization switched off. I've tried rebuilding the solution so that there's no old .pdb or such, with no effect.
Any tips what might cause this? How to make the debugger show all variables?
Upvotes: 2
Views: 1249
Reputation: 6436
Solution:
Please selected one of your projects in Solution Explorer before you type the command line in Immediate Window. It will work well.
Upvotes: 1