Welcome to MSDN Blogs Sign in | Join | Help

Sara Ford's Weblog

My adventures embracing open source on CodePlex and at Microsoft

News

    • Did you know... All author proceeds go directly to sending Hurricane Katrina survivors to college.

      Microsoft Visual Studio Tips book

      Recent Entries

Did you know... What's the difference between the Autos window and the Locals window? - #316

I've always wondered this, but finally took the time to ask Dustin Campbell when I met with him last week for Debugger tips.

The autos window shows the current statement and the previous statement.  it was always the previous statement that threw me off, as i never took the time to look closely enough to realize that's where that variable was coming from.

The locals window shows everything currently in scope. Thus, the autos window is a subset of the locals window.

For example, consider the following code snippet that does nothing but produce warnings for unused variables:

Code snippet showing some variables

In the Auto windows, you'll see the previous statement and the current statement being evaluated:

Auto windows showing previous and next statements

In the Locals window, you'll see the everything in scope, including the args parameter:

Locals window showing everything in scope

Technorati Tags: ,
Posted: Thursday, September 18, 2008 3:00 AM by saraford

Comments

Serge Wautier said:

> the autos window is a subset of the locals window.

the autos is not limites to locals, right? Doesn't it display everything in the current (and previous) statement, not only the local variables.

Cheers,

# September 18, 2008 8:57 AM

GregM said:

Did you by chance ask him where the "this" window went?  I've been unable to find it in VS2005.

# September 18, 2008 1:59 PM

BOW said:

The Auto window will show the return value of the function but the Local window will not.

If you are looking the return value of one function like:

xxxx(a(), b());

The return value will appear in the Auto window but not in the Local window.

This is my experience.

# September 18, 2008 10:11 PM

DanielMoth said:

The Autos window does not work like that for VB - maybe you/Dustin should qualify that you are only referring to C# behavior.

# September 19, 2008 5:02 AM

Jher Von Arbanel said:

Hi, good article, but i think u are the best person to who i can ask this.

how to i implemet the auto windows in my editor, msdn say that its not implemente, i have studied and investigated, that AuthoringSink has methos to use with auyos windows, but msnd say that during debug the debugger call a method in languageservice called GetProximityExpressions but for it never reaches it,

all other feautes of th vs editor i have already implement but this i couldn't yet, could u help which are the steps i hace to follow to implemte autoswindows

# September 30, 2008 6:05 PM

Patric said:

In my VS 2008, the Autos window disappeared and I can't find an option to show it up again! How can I get the window back?

Thx for your help!

# October 15, 2008 6:51 AM

GregM said:

Patric, it's at Debug>Windows>Autos

# October 21, 2008 9:46 AM

Patric said:

GregM, unfortunately, I don't have this option. Within Debug>Windows there's only Breakpoints; Watch; Locals; Call Stack; Threads during debugging.

During design, there's only Breakpoints.

Do I have to install something or modify VS' settings?

# November 11, 2008 7:30 AM

xjb said:

# March 2, 2009 8:18 PM
New Comments to this post are disabled
Page view tracker