2

Python allows the following: once I open cmd I can start python and then run python commands which return results directly in cmd. For example, I type print word and cmd returns word. Is there a similar thing for C# or the only way to execute C# code is to write it in a file and then compile it?

1
  • If you search for C# REPL (read-eval-print-loop), you will find several possibilities, both on google and here on StackOverflow. The mono REPL seems to be the most mature, maybe together with LINQPad. We're all waiting for Roslyn though :-) Commented Dec 5, 2012 at 8:48

1 Answer 1

5

Use PowerShell.

This will allow you to access the objects in the .Net Framework as well the objects in the operating system.

Check this simple example:

enter image description here

Or you can check this advanced example:

http://blogs.technet.com/b/stefan_gossner/archive/2010/05/07/using-csharp-c-code-in-powershell-scripts.aspx

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.