Now this might be a dumb question, but I’m still new to using Visual Studio 2008 but I was wondering if there is a feature like this (I’m using webforms ASP.NET C#).
I create a new method, highlight it in the editor and was wondering if there was a run/test method feature? Where it would exectute the method and prompt me via a UI for any variables the method might need to run?
I just thought this would really increase my productivity / speed in creating applications :S
You can use the console window in VS to test individual methods – provided the surrounding class compiles error-free. The console window can be activated via the View menu, IIRC.
Once inside the debug console, just enter the class name, followed by the method name (if it’s a
staticmethod) or create an instance, if not. Printing the result can be done by prefixing the whole thing with?, e.g.: