Return Value in Visual Studio Autos Window

When I was working in C ++, I remember that Visual Studio had an entry in its Autos window when returning from a function call. This entry will tell me which value was returned from this function.

It can be argued that if a function returns a value, then you must set the variable to that value, i.e.

int i = GetRandomInt(); 

But as a far-fetched example, suppose I wanted to do this:

 CycleTushKicker( GetRandomInt()); 

Instead of going into CycleTushKicker to find out how much my baby is licking, I just wanted to know the value as soon as I GetRandomInt .

Is there any way to get this when using C #?

EDIT - Followed the advice of @Michael Goldshetyn and filed a Microsoft Connect feature offer. You can put your votes here: https://connect.microsoft.com/VisualStudio/feedback/details/636130/display-return-value-from-function-in-autos-window-for-c

+7
source share
2 answers

There is no way to see the return value of a function in the Autos VS2010 panel when using C #. If you want to see this value, you need to assign it a temporary variable, and then you will see this value of the variable (at least in debug builds).

Update

VS2013 now offers this functionality

+2
source

It’s better to just use a temporary variable.

This will allow you to see this in the debug windows, but also allow you to set a breakpoint and perform cleanliness for each function individually.

By doing the following:

 var randomInt = GetRandomInt(); CycleTushKicker(randomInt); 

You actually create the exact same code, but it is much easier to debug.

0
source

All Articles