开发者

Is there a C# tool that will let me execute an arbitrary block of code? [closed]

开发者 https://www.devze.com 2022-12-08 21:56 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
开发者_C百科

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 6 years ago.

Improve this question

I'm sure something like this exists, but I can't for the life of me remember what it is called.

I'm looking for an app where I can just execute an arbitrary block of C# code and see any console output.


http://www.sliver.com/dotnet/SnippetCompiler/


Snippet Compiler


Not necessarily a snippet compiler but I use it for that purpose also:

  • LINQPad

The neat thing about it is that you can dump intermediate results to the output and has very nice formatting for all types of objects so you won't have to write Console.WriteLine(...) statements.

You can also write only expressions, or simple statements or classes, and it will compile all of them.


There is also LINQ Pad. It will work as a snippet compiler and lets you run linq against sql server.


Mono has GSharp, which I personally use all the time.

http://tirania.org/blog/archive/2008/Nov-02.html


Another approach is offered by TestDriven.Net, which allows you to click on any method in the Visual Studio code editor and run it directly.

This can be useful for debugging code that's otherwise buried a little deep to conveniently access.


To round out the other answers, there's also:

  • Snippy (by Jon Skeet) - also check out the Reflector add-in (be sure to look for the latest version on the author's blog).
  • Matthew Manela's FastSharp.

LINQPad is my favorite :)

0

精彩评论

暂无评论...
验证码 换一张
取 消