Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run instance method with visual studio command while debugging

I was wondering if there is a trick somewhere to be able to run methods with a visual studio command or something.

For instance, lets say I created a new instance of type Connection in void Main and saved it to a static variable within the Program class. Now, lets say my program is running under the VS2012 debugger, and i would like to arbitrarily execute the method Connection.Blah(int, string) on the instance of Connection that is held up in my Program class from visual studio, with no prior code to do so.

Is there a way to do this?

like image 582
caesay Avatar asked Mar 03 '13 07:03

caesay


1 Answers

Yes. Use the Immediate window. Punch in FullyQualified.Name.To.Program.staticvar.Blah(0, "foo"), hit enter.

like image 165
user314104 Avatar answered Oct 02 '22 14:10

user314104