I have following code snipped:
...
var tpc = new ThirtPartyClass();
tpc.ExecuteCommand();
tpc.ExecuteCommand();
...
The ExecuteCommand() method returns a int value with some information.
For debugging, I want to know this return values. But I don’t want to assign the result to a variable (var result = tpc.ExecuteCommand()).
Is there in VisualStudio 2010 a possibility during debugging, to inspect this return value without assign it to a temporary variable?
Thanks in advance for your suggestions
edit: Finally, this function has been added to VS2013
You can do that with IntelliTrace in VS2010, by switching to the “Calls View” then checking the Autos window:
But even without that, don’t worry about it; if you don’t use the variable (except by looking in the debugger when paused), then in a release build it will be removed and replaced with just a “pop” (which is what you get if you don’t catch the return value in the first place).
So:
Compiles as:
note no
.localsand nostloc.For Resharper, use: