Element Inspector in Visual Studio - visual-studio

Hey, I accidentally closed that window in VS that you can use to inspect variables and the like, and I can't find anywhere to get it back; where do I find it? Thanks.

Try the following
Debug -> Windows -> Locals
It may be Immediate or Watch instead of Locals depending on what you are looking for. You will need to be in the middle of a Debugging session for Locals or Watch to show up.

Related

Can i print the information of the locals window in my application visual studio?

I am wondering, if there is any way that let us print all the variables and their values that are displayed on locals window.
To be clearer ,I do want to create a application that works same as locals window in the visual studio during a process execution. Can I know how it could be acheived? Thankyou in advance.
Not found the possible solution for it. If you just want to get the variable value, one workaround is that you could use the immediate window instead of local window. Or you could customer Debugging watch window to output the view lists you want to get with native extension.
Output a watched Visual Studio variable to a file
But not found the way to achieve it using the local windows.
I help you submit a feature request to the product team here:
https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/30957622-can-i-print-the-information-of-the-locals-window-i
If possible, you could also vote and add your comment there.

Visual Studio 2013 doesn't show local variable values during debugging

My VS2013 doesn't show local variable values when I start debugging by setting a breakpoint as shown in the attached picture with red question mark. I have already checked "Use Managed Compatibility Mode" but it doesn't work for me. Please suggest what I am supposed to do.
From the screenshot it looks like you are viewing the "Watch 1" window (used for evaluating expressions and variables). What you're looking for is called the "Locals" window. You can find it using the menus Debug -> Windows -> Locals while running the solution.

How to filter output in Visual Studio 2012+?

I am having problem inspecting specific things in my Debug.WriteLn output in Visual Studio 2015. (Same thing in 2012 and 2013 version too.)
XCode and Eclipse both include a filter-box on top of the Output window. I tried to find a similar extension for Visual Studio but I had no luck. Is there any way to have a similar feature and filter the output window?
I use this method:
Open Debug – Output window, just by right click on the Window.
You can Check / Uncheck as per your need.
One thing I just found in VS 2017 (and I think it's in other versions too) is:
Tools | Options | Debugging | General > Redirect all Output Window text to the Immediate Window
This gives you just the program's Debug.WriteX output in the immediate window and leaves all that other trash in the output window, which you can leave closed.
I can still go look at the trash in the output window if I need to for some reason; it isn't suppressed. It just doesn't make it into the immediate window.
And I just leave the little immediate window docked at the bottom.
I think it's good because with all the trash coming out in the output window, I really wasn't paying any more attention to the output than I would a terms of use agreement (which is to say, just about none), so the baby was getting thrown out with the bath water. But now I actually see some program debug output that lo and behold, needs attention.
IMHO Microsoft should expand the output window dropdown box to include all the categories that FetFrumos pointed out in his answer, so developers can just leave it set to "Program Output". I think this would be a good improvement.
Various services in VS write to the output window so there is an in-built filter based on source. You can often select the source such as "Build Output", "Test discovery", "General", "Debug" etc.
Debug.Write calls are intercepted by VS and the text ends up in the Output window but there is no in built filtering.
I can think of 3 ways around this:
Use DbgView to intercept the Debug.Write messages instead of letting VS intercept them. DbgView has very powerful filtering and coloring features*
Try this extension that colors the output based on regular expressions
Write your own extension (it's not that difficult!)
(*) If you go down this route note that Debug.Write is just a trace and when you attach the VS debugger it will add itself as the trace lister. Same for DbgView. But when you detach it will not remove the listener and the messages will be lost.
I've wanted to filter Visual Studio output for many years. Eventually I decided to write an extension to do it. If you're interested, you can check it out at niahtextfilter.com.
Here's an idea of what it does:

Android Studio Watch Expression persistence

Android Studio removes all my watch expressions after each debug.
How can I force it to keep my watches and save them in project?
There's no way to do save watches that I know of. However you can use "Auto-Variables-Mode" (bottom left debugger tab >> settings button). This will clean up some of the less desired variables in the debugger variables window, then hopefully you'll need less watches.
I have found that variables entered when not in debugging mode are lost since the interface cannot figure out the statements when they are not compiled and running.
Hopefully you have the same problem as me and starting debugging before entering your variables fixes it.

Lost window in visual studio 2010

I am new and stupid. I closed this window:
How this window is called and how to activate it. Make it pop up.
It is the Locals window.
You will find it under Debug -> Windows.
Alternatively, use the keyboard shortcut Ctrl + D + L.
It is only available during a debugging session and is not available on Express editions.
Go to the Debug menu then windows then locals and it will show up. You must be in the middle of debugging to have it show in the list.
The Locals window comes up with you start debugging (hit F5). If you need it back, go to Debug > Windows > Locals while debugging.
Note, you can also get it back if you click Windows > Reset Window Layout (which I've had to use on occasion when windows get really messed up!) Be warned that this will erase any changes you've made to the layout. But sometimes it is worth it!

Resources