I come from a lisp background where I could 开发者_高级运维type in snippets to the command line while coding, to make sure I get a small chunk of code correct the first time. Its great for testing string formatting, simple math calls, etc without having to recompile a whole project to test small changes.
Is there a feature or add-in in visual studio 2010 to get this type of functionality, say like a watch window that runs when you aren't actually executing the program?
You can abuse the Intermediate window to evaluate things (in debug mode). However, i'd suggest LinqPad it has basic code execution on the fly.
As well as LinqPad mentioned by Aren, you might want to look at Mono's CsharpRepl.
I don't know if either of these have Visual Studio add-ins available, but it's an interesting thought...
I usually use LinqPad, but have you tried the immediate window? Personally, this kind of thing is great for creating a unit test.
One other you should check out is Snippet Compiler
精彩评论