When debugging in Visual Studio, can you see what is returned from the method?

I have a method like:

object bibble()
{
  return GetFishsticks();
}

I go through the code to the return line and press F10 to go to the next line ... so the selected line is on the button}

I would like to see that coming back, but I can’t figure out how to do this. Is there any way to see this?

Edit (by Doc Brown): sometimes it bothers: is there a way to check the return value without changing the code and not call it GetFishsticksagain to avoid possible side effects?

+3
source share
6 answers

Do it like this ...

object bibble()
{ 
    object fishSticks = GetFishsticks();
    return fishSticks;
}

Now you can put breakpint in the return statement.

+4
source

# ( ) . VB.NET ​​ - VB6. blog.

+2

( ) , , bibble.

+1

SLC, "", .

0

, , ? "GetFishsticks()" . , , .

0

, Immediate?

I know that you can use the Immediate window to get the value, but I don’t know if it also works for the method, but it would be easy to find out.

Edited: I just did a test and it works great. Just write GetFishSticks()in the "Immediate" window and press "Enter", and the result will be shown below.

0
source

All Articles